Test for element in array

Don Clugston dac at nospam.com.au
Fri Jul 14 00:04:11 PDT 2006


Andrei Khropov wrote:
> BCS wrote:
> 
>>  if({foreach(i;a) if(i==j) return true; return false;}())
> 
> Yeah, this new delegate syntax is cool !

Wow! I didn't know you could have a naked {} like that as a void 
delegate. That is cool. Looks as though D has sucked all the juice out 
of C++, and is moving onto the scripting languages...




More information about the Digitalmars-d-learn mailing list