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
Curried form different from "normal"
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-02-05 (16:59)
From: David Baelde <david.baelde@g...>
Subject: Re: [Caml-list] Curried form different from "normal"

Your statement is true only for purely functional definitions. Here,
there is a difference. The following piece of code is evaluated only
one, at the time of the outermost definition. So trailing is
instantiated only once.

>       if !is_first then
>         trailling:=Buffer.contents white
>       else
>         Buffer.add_buffer buf white;
>       Buffer.reset white;
>       is_first:=false;

This kind of effect is sometimes expected, however.

Have fun.