Revised RFC on range design for D2

Tom S h3r3tic at remove.mat.uni.torun.pl
Thu Oct 2 15:53:06 PDT 2008


Andrei Alexandrescu wrote:
> 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.

I guess that someone was me (and at the NG, so you remember right). But 
yea, let's just trivialize all the broken code and surrounding issues :P
People actually wanted to burn lazy evaluation on a stack, and my post 
was merely an attempt on reaching a compromise.

And I didn't really say it was all fine and dandy. Why not? Suddenly you 
got conflicts between:

void foo(int delegate())
void foo(int)

Apparently some libraries used that. And I don't think that any of my 
own libs were the issue. So please bear in mind that there were more 
people behind it and their frustration level was at some point pretty 
high (along the lines of "Walter keeps releasing new stuff and instead 
of fixing old issues, breaks fine code. [Expletive deleted] this."). If 
you had ideas to work it out, it would've been fine time to state them. 
I'm actually looking forward to the solution for D2.0.


-- 
Tomasz Stachowiak
http://h3.team0xf.com/
h3/h3r3tic on #D freenode


More information about the Digitalmars-d-announce mailing list