From: Hugo Herbelin <Hugo.Herbelin@inria.fr>
To: garrigue@kurims.kyoto-u.ac.jp (Jacques Garrigue)
Cc: caml-list@inria.fr
Subject: Re: Undefined evaluation order: define it for constructors ?
Date: Thu, 12 Oct 2000 15:26:35 +0200 (MET DST) [thread overview]
Message-ID: <200010121326.PAA07988@pauillac.inria.fr> (raw)
In-Reply-To: <20001012173521W.garrigue@kurims.kyoto-u.ac.jp> from Jacques Garrigue at "Oct 12, 100 05:35:21 pm"
As Jacques Garrigue underlines it, discussions are less about the
evaluation order of arguments of functions that those of tuples and
the latter looks like strictly arbitrary (I guess it was initially
chosen right-to-left by consistency with the evaluation order of
arguments which is not arbitrary). To make evaluation of tuple LR or
RL is then just a matter of principle... and to guarantee it for the
user also!
It is sometimes useful to do side-effects with "List.map" (or
"Array.map"): it leads to code more readable than if using
"fold_left". I'd be happy if the evaluation order of "map" in the
interface were specified, as it is the case (for a good reason) for
the "iter" functional.
Furthermore, in O'Caml (in contrast with Caml-Light -- a teaching
language!), List.map and Array.map are written in such a way they
evaluate as we write lists, i.e. from left to right! Is it not
the right time to say it?
Regarding the evaluation order of arguments for functions, is it
only to adapt polymorphism with the stack-model on which the bytecode
interpreter relies? If so, what would be the overhead if the frame
were first allocated then arguments evaluated LR but put in the frame
in the _reverse_ way in order (possibly incremental) capture of
arguments by the function continues to work.
Hugo
next prev parent reply other threads:[~2000-10-12 13:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-10-11 12:22 Undefined evaluation order Greg Morrisett
2000-10-11 20:35 ` Pierre Weis
2000-10-13 7:05 ` Judicael Courant
2000-10-13 14:21 ` Markus Mottl
2000-10-16 8:38 ` Christophe Raffalli
2000-10-16 15:48 ` Brian Rogoff
2000-10-16 16:29 ` Christophe Raffalli
2000-10-17 9:19 ` Ralf Treinen
2000-10-12 8:35 ` Undefined evaluation order: define it for constructors ? Jacques Garrigue
2000-10-12 13:26 ` Hugo Herbelin [this message]
2000-10-12 14:10 Dave Berry
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=200010121326.PAA07988@pauillac.inria.fr \
--to=hugo.herbelin@inria.fr \
--cc=caml-list@inria.fr \
--cc=garrigue@kurims.kyoto-u.ac.jp \
/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