Fully dynamic d by opDotExp overloading

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sat Apr 18 14:47:23 PDT 2009


davidl wrote:
> 在 Sun, 19 Apr 2009 02:16:30 +0800,Andrei Alexandrescu 
> <SeeWebsiteForEmail at erdani.org> 写道:
> 
>> bearophile wrote:
>>> Andrei Alexandrescu:
>>>> Yes. The amount of confusion in this thread is staggering.
>>>  I think I have misunderstood about the whole thread then. If the 
>>> string isn't determined at run time, then this thing isn't useful for 
>>> my purposes, and it's not close to the object-C as I was talking 
>>> about, and it's not similar to __getattr__ of Python, etc.
>>>  Bye,
>>> bearophile
>>
>> In the syntax
>>
>> a.b
>>
>> how would either of a and b be identified at runtime? I mean, you 
>> write the code somewhere and it gets compiled. It's not like you're 
>> reading "a.b" from the console and then call some eval() function 
>> against them.
>>
> 
> Depends on the compiler semantic. The compiler can feed the opDot with 
> the variable b if it's a string. The compiler can intepret the opDot 
> that way.

I agree it "can". I don't agree it "can if it's not out of its mind". 
That lookup method is extremely unhygienic.

Andrei



More information about the Digitalmars-d mailing list