Order Evaluation in List Comprehension

Ben Hyde <>
Fri Dec 18 23:50:27 CET 1998


So is this good or bad? - ben

----
  -module(hack).
  -export(black_box/1]).
  black_box(X) -> [ begin io:format("~p\n", [E]), E end || E <- X ].
----
  
  ()28>c(hack)
  {ok,hack}
  ()29>hack:black_box([1,2,3,4]).
  4
  3
  2
  1
  [1,2,3,4]
  ()30> [begin io:format("~p\n", [E]), E end || E <- [1,2,3]].
  1
  2
  3
  [1,2,3]
  ()31> 



More information about the erlang-questions mailing list