Why doesn't map!(a => writeln(a)) print anything?

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Apr 17 18:04:23 PDT 2015


map evaluates its arguments on demand. Think of it as returning a 
function that does the work instead of actually doing the work - 
you still need to call that function, which happens when you loop 
over it.

std.algorithm.each is more appropriate for acting now.


More information about the Digitalmars-d-learn mailing list