DIP6: Attributes

Ary Borenszweig ary at esperanto.org.ar
Tue Aug 4 13:10:51 PDT 2009


Steven Schveighoffer wrote:
> On Tue, 04 Aug 2009 15:56:16 -0400, Ary Borenszweig 
> <ary at esperanto.org.ar> wrote:
> 
>> Andrei Alexandrescu wrote:
>>>  Well some don't like to need to remember the order of arguments.
>>
>> But that's a way totally different thing discussed here.
>>
>> First you need to introduce argument names when invoking a function.
>>
>> void foo(int timeout, string bar) {
>>     ..
>> }
>>
>> Can be used as:
>>
>> foo(timeout=5, bar="100")
>>
>> (with some other syntax, of course)
>>
>> Once you have that, you could do:
>>
>> call!(foo)(timeout=5, bar="100")
>>
>> Voilà!
> 
> It could also be accomplished via a fully implemented reflection 
> library, which is my side topic for this thread branch :P
> 
> For instance you could do this exact thing in C#, even though C# doesn't 
> support named parameters.

Aaaaaaah... I see now. :)



More information about the Digitalmars-d mailing list