digitalmars.D.learn - Why doesn't map!(a => writeln(a)) print anything?
- Mark Isaacson (2/2) Apr 17 2015 Why can't I print things using the map algorithm?
- Adam D. Ruppe (5/5) Apr 17 2015 map evaluates its arguments on demand. Think of it as returning a
- Mark Isaacson (2/7) Apr 17 2015 Ahhh.... cool. Thanks!
Why can't I print things using the map algorithm? Specifically: http://ideone.com/VLp4Xa
Apr 17 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.
Apr 17 2015
On Saturday, 18 April 2015 at 01:04:24 UTC, Adam D. Ruppe wrote: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.Ahhh.... cool. Thanks!
Apr 17 2015