English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] laziness
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-09-04 (11:22)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] laziness
On Sat, 2004-09-04 at 18:40, Marcin 'Qrczak' Kowalczyk wrote:
> skaller <skaller@users.sourceforge.net> writes:
> > However if the call is *inlined* to get
> >
> > 	if c' then a' else b'
> >
> > then perhaps a' or b' will never be evaluated.
> No. Inlining is considered an optimization, which implies that it
> doesn't change the semantics except when it was not fully specified
> in the first place.

I understand that argument -- but that doesn't mean the
compiler conforms to the specification, nor that the
specification is best.

> E.g. the order of evaluation of arguments is
> unspecified, so it might be different depending on inlining; but
> OCaml does specify that each argument are evaluated exactly once
> and inlining doesn't change that.

Must they be evaluated before the function is called?

John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net

To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners