Objective-D, reflective programming, dynamic typing
grauzone
none at example.net
Fri Apr 3 09:53:05 PDT 2009
Andrei Alexandrescu wrote:
> grauzone wrote:
>> Andrei Alexandrescu wrote:
>>> grauzone wrote:
>>>> Andrei Alexandrescu wrote:
>>>>> void fun(...)
>>>>> {
>>>>> ... use void* _argptr and TypeInfo[] _arguments ...
>>>>> }
>>>>>
>>>>> I'll ignore the fact that binding the arguments to magic,
>>>>> predefined names has the elegance of a fart interrupting a solemn
>>>>> moment. The larger problem is the type of _argptr.
>>>>
>>>> That surprises me. Your string mixin callbacks (or whatever is the
>>>> correct name for this idiom) in std.algorithm also use magic,
>>>> predefined names like "a".
>>>
>>> The situations are different. (The "$" in array index is also
>>> different.)
>>
>> How are the situations different?
>
> I don't have much time to explain, but the code in which a and b are
> used (which is restricted to an expression) cannot possibly define its
> own symbols called a and b. Also, user code can never define $. In
> contrast, _arguments is a valid, nonreserved D symbol that's just up for
> grabs.
K. Then rename _arguments to $arguments. Problem solved.
More information about the Digitalmars-d
mailing list