From: Jakob Lichtenberg <jakobl@windows.microsoft.com>
To: <caml-list@inria.fr>
Subject: Syntactical Array constructor evaluating elements from right to left - Why?
Date: Wed, 19 Sep 2007 10:32:18 -0700 [thread overview]
Message-ID: <43CD2D195487A448934920501C6EDB2305BD2DEC@WIN-MSG-21.wingroup.windeploy.ntdev.microsoft.com> (raw)
[-- 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 --]
next reply other threads:[~2007-09-19 17:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-19 17:32 Jakob Lichtenberg [this message]
2007-09-19 18:16 ` [Caml-list] " Jon Harrop
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43CD2D195487A448934920501C6EDB2305BD2DEC@WIN-MSG-21.wingroup.windeploy.ntdev.microsoft.com \
--to=jakobl@windows.microsoft.com \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).