DIP6: Attributes
Ary Borenszweig
ary at esperanto.org.ar
Tue Aug 4 11:46:34 PDT 2009
Steven Schveighoffer wrote:
> On Tue, 04 Aug 2009 13:44:46 -0400, Ary Borenszweig
> <ary at esperanto.org.ar> wrote:
>
>> Andrei Alexandrescu wrote:
>>> Steven Schveighoffer wrote:
>>>> What I'd like to see is something like this possible:
>>>>
>>>> void foo (int timeout, string bar, float f = 4.0);
>>>>
>>>> void foo(int timeout);
>>>>
>>>> call!(foo)("timeout=5,bar=\"hello\"");
>>>>
>>>> Taking into account the default value of f, what the parameters are
>>>> named, and which overload to call. I could certainly do it with C#.
>>> This is interesting. It means we'd need reflection for parameter
>>> names, which currently does not exist.
>>
>> Why do it with strings? Why not
>>
>> call!(foo)(5, "hello")
>>
>> with varaidic args?
>
> Ok, say foo is:
>
> void foo(string bar, int timeout)
What's the difference?
More information about the Digitalmars-d
mailing list