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
Misunderstandings about the AST
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-03-28 (06:42)
From: Loup Vaillant <loup.vaillant@g...>
Subject: Re: [Caml-list] Misunderstandings about the AST
Thank you for your help, I will get back to work.

2007/3/27, Nicolas Pouillard <nicolas.pouillard@gmail.com>:
> On 3/27/07, Loup Vaillant <loup.vaillant@gmail.com> wrote:
> > | Pexp_lazy of expression
> > Why does this constructor even exist? Are some specific optimizations made?
> Since the evaluation of the expression is delayed it's not a plain function.

Actually, I knew that.
However, given the following expressions are semantically equivalent:

lazy expr;;
lazy_from_fun (fun () -> expr);;

With "lazy_from_fun" being a plain function,
my point is then to know if they are really equivalent
(e.g. implementation wise), so I can assume
the keyword "lazy" is just syntactic sugar.


PS: Nicolas, Sorry for the double post, I messed up the "reply" button.