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
Parameter evaluation order
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-08-27 (17:39)
From: Christophe TROESTLER <debian00@t...>
Subject: Re: [Caml-list] Re: Parameter evaluation order
On Fri, 26 Aug 2005, Christophe Raffalli <christophe.raffalli@univ-savoie.fr> wrote:
> Remark: clearly, a good proof system should not show the monadic 
> translation and hide it behind the scene ...

Shouldn't a good proof system show the code to be correct regardless
of the evaluation order of function args, records,...?  After all,
different evaluation orders may be interesting on different platforms
and I think programs that rely on the evaluation order (say) of
functions arguments to be correct are fragile -- they have a great
potential to be broken at the first maintenance.

On Fri, 26 Aug 2005, Fernando Alegre <fernando@cc.gatech.edu> wrote:
> Ignoring efficiency concerns, may I suggest that the correct way to
> build lists is by appending elements, not prepending them:
> # append('d', append('c', append('b', append('a', []))));;
> - : char list = ['a'; 'b'; 'c'; 'd']

It is not.  You have to respect their recursive definition, from which
it is clear that "append" is not a primitive operation.  The data
structure that you contruct with "append" and deconstruct with "head"
is a FIFO queue.

I've been skimming through the discussion and basically I do not
understand you guys who want a given evaluation order for function
application, constructors,...  First there is a way of imposing
evaluation order of expressions if you need it and moreover, you are
using a functional language which emphasizes immutability for which
evaluation order does not matter...

My 2˘,