davidl wrote:
在 Sun, 19 Apr 2009 02:16:30 +0800,Andrei Alexandrescu
<seewebsiteforem...@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