www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: I wrote some D today and it's completely blowing my mind. Ever

reply Kagamin <spam here.lot> writes:
downs Wrote:

 Don't know why you bother with Reddit, Walter.  Going by a lot of the replies
there, its a case of
 pearls before swine.
 
 Cheers
 -- Justin Johansson
 

Swine are smart.

Indeed. I like this comment:
Of course, but they'll have to look at the function signature to see that.

If you're reading code to find a bug, it won't be immediately obvious what's
going on. In the worst case you'll need to recursively inspect all function
signatures used by each function.

One of Walter's goals was to make certain classes of bugs more difficult to
occur -- a laudable one. Unfortunately this feature makes things harder to
reason about.

Oct 06 2009
parent reply Kagamin <spam here.lot> writes:
Lazy arguments are half-lambdas.

void some_function(int x, lazy int y);
void some_function(int x, int delegate() y);

some_function(x, y++);
some_function(x, (){ y++ });

Though typesavers will complain a lot.
Oct 06 2009
parent Justin Johansson <no spam.com> writes:
Kagamin Wrote:

 Lazy arguments are half-lambdas.
 
 void some_function(int x, lazy int y);
 void some_function(int x, int delegate() y);
 
 some_function(x, y++);
 some_function(x, (){ y++ });
 
 Though typesavers will complain a lot.

Often when the Marxes arrived at restaurants, there would be a long wait for a table. "Just tell the maître d' who we are," his wife would nag. (In his pre-moustache days, he was rarely recognized in public.) Groucho would say, "OK, OK. Good evening, sir. My name is Jones. This is Mrs. Jones, and here are all the little Joneses." Now his wife would be furious and insist that he tell the maître d' the truth. "Oh, all right," said Groucho. "My name is Smith. This is Mrs. Smith, and here are all the little Smiths." <small>Above quotation from http://en.wikipedia.org/wiki/Groucho_Marx and reproduced here under Creative Commons Attribution-ShareAlike 3.0 Unported License http://creativecommons.org/licenses/by-sa/3.0/</small> <JJ/>
Oct 06 2009