list comprehension question

Carsten Schultz carsten@REDACTED
Fri Jul 29 00:11:02 CEST 2005


Hi!

Charles Blair schrieb:
> [...] and since the documentation for lists:map says "The
> evaluation order is implementation dependent" [...]

The evaluation order is not the same as the order of the elements of the
result list.

lists:reverse(lists:map(F, lists:reverse(Xs)))

and

lists:map(F, Xs)

yield the same result (if F is without side effects!), ie the orders of
the elements in the result lists are the same, but they do not evaluate
the elements in the same order.

hth

Carsten

-- 
Carsten Schultz (2:38, 33:47)
http://carsten.codimi.de/
PGP/GPG key on the pgp.net key servers,
fingerprint on my home page.



More information about the erlang-questions mailing list