Function pointers/delegates default args were stealth removed?
Carl Sturtivant
sturtivant at gmail.com
Mon Aug 27 03:20:48 PDT 2012
On Monday, 27 August 2012 at 10:12:28 UTC, Simen Kjaeraas wrote:
> On Mon, 27 Aug 2012 11:57:45 +0200, Carl Sturtivant
> <sturtivant at gmail.com> wrote:
>
>>> Suppose a function pointer can be called with fewer actual
>>> arguments than the number of parameters in its declaration.
>>> Suppose that when such a call is made, the missing arguments
>>> will always be assigned the default initialization for their
>>> types (default default-arguments!). Now suppose that a
>>> language mechanism is provided so that code in the function
>>> body can determine how many actual arguments were supplied at
>>> the point of call.
>>>
>>> Now any function pointer can simulate other default arguments
>>> (non-default default arguments) by testing the actual number
>>> of arguments supplied and assigning defaults overtly to the
>>> remainder inside the function body. No need for new types:
>>> this is a run-time action.
>>
>> That's a great idea Carl!
>
> You *do* know you're talking to yourself, right?
My alter ego, you mean?
Someone has to talk to the poor guy.
More information about the Digitalmars-d
mailing list