www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: Full closures for D

David B. Held Wrote:
     auto base = "/path/to/dir/";
     auto absoluteDirs = map({ return base ~ $0; }, readdir(DIR));
 Notice that this is just about as close to the Perl/Haskell form as D is 
 likely to ever get.  And it's a thing of beauty.  Of course, this is a 
 small (but real) example, so it doesn't fully illustrate the utility of 
 implicit lambda args, but don't you agree that this would be cool?

Thx for template. Really nice. Vote++
Nov 07 2007