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
compiler question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-07-23 (07:58)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] compiler question
On Sat, Jul 22, 2006 at 09:19:15PM +0200, Michael Wohlwend wrote:
>   let idx = ref 0 in
>   try
>     while true do
>       a0.(!idx) <-get32 file;

You shouldn't rely on the order that these are executed.  Normal
parameter evaluation (which this is not) in OCaml happens to be right
to left, but it's not defined to be that way.  Use the let binding if
you depend on a particular ordering.

> let t = get32 file in
> a0.(!idx) <- t;


Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Team Notepad - intranets and extranets for business - http://team-notepad.com