* Syntactical Array constructor evaluating elements from right to left - Why?
@ 2007-09-19 17:32 Jakob Lichtenberg
2007-09-19 18:16 ` [Caml-list] " Jon Harrop
0 siblings, 1 reply; 2+ messages in thread
From: Jakob Lichtenberg @ 2007-09-19 17:32 UTC (permalink / raw)
To: caml-list
[-- Attachment #1: Type: text/plain, Size: 365 bytes --]
Why is the syntactical array constructor [| ... |] evaluating elements
from right to left:
# let f i = (Printf.printf "%d\n" i; i);;
val f : int -> int = <fun>
# Array.init 3 f;;
0
1
2
- : int array = [|0; 1; 2|]
# [| f 0 ; f 1; f 2|];;
2
1
0
- : int array = [|0; 1; 2|]
Thanks,
- Jakob
[-- Attachment #2: Type: text/html, Size: 5509 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-09-19 18:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-19 17:32 Syntactical Array constructor evaluating elements from right to left - Why? Jakob Lichtenberg
2007-09-19 18:16 ` [Caml-list] " Jon Harrop
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).