Full closures for D

Simas simas at gmx.net
Wed Nov 7 05:40:06 PST 2007


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++






More information about the Digitalmars-d mailing list