Revised RFC on range design for D2
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Thu Oct 2 13:00:45 PDT 2008
Bill Baxter wrote:
>>> Running version=a prints "hi" while version=b prints "true." If there
>>> were
>>> some way in the language to say "cond() is a property" then this issue
>>> would
>>> not be silently introduced when changing cond from a variable to a method.
>> Oh how I am with you on this. I've always thought mentioning a delegate name
>> should NOT EVER evaluate the delegate. Walter definitely took the wrong turn
>> down that alley there. And guess what. He got ambushed by the "lazy" keyword
>> right there. I told Walter to not do that "lazy" keyword, he disregarded,
>> but the time will come when that stone will be turned.
>>
>>
>> Andrei
>>
>
> He mentions your name right there on the description of lazy, though.
> I always thought it was basically your idea because of that, or at
> least that you designed it together. Given what you are saying above,
> you might want to ask him politely to remove your name from that page.
I suggested that a function taking a delegate should accept an unadorned
expression:
void twice(void delegate() fun) { fun(); fun(); }
...
int a;
twice(++a); // makes a = 2
That has a number of issues itself, which can be worked out. Then
somebody (in the newsgroup if I remember correctly) said, well this is
fine and dandy, but just add a "lazy" keyword there. He did, and I knew
it was a mistake the first time I saw it.
Andrei
More information about the Digitalmars-d-announce
mailing list