Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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;

Rich.

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