Properties

bearophile bearophileHUGS at lycos.com
Sun Jan 11 08:00:55 PST 2009


Nick Sabalausky:
> Even if it weren't for that, I would still consider this important enough to 
> be worth the hassle of changing it. It would be better than letting D 
> forever maintain the cruft of a particularly bad design decision (no 
> offense, Walter) in the same way that C++ would.

But I am not sure that proposed idea is the best, because in Python (that acts like that) you often enough write for mistake:

x = foo

Forgetting the (). In this case x gets a (kind of) reference to foo and not to its result. You can do something similar in that D proposal:

auto x = foo

So I think &foo and foo() are more explicit and better (better == less error-prone), to represent the pointer/delegate/closure, and to represent the calling.

Bye,
bearophile



More information about the Digitalmars-d mailing list