Version française
Home     About     Download     Resources     Contact us    
Browse thread
'a Set?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Radu Grigore <radugrigore@g...>
Subject: Re: [Caml-list] 'a Set?
On Wed, 26 Jan 2005 21:04:00 +0900 (JST), Jacques Garrigue
<garrigue@math.nagoya-u.ac.jp> wrote:
> There seems to be an habit of having side-effecting functions take
> their "object" as first parameter, while side-effect-free functions
> take them as last.

This makes sense; but it does not seem to be respected by the standard
library. For example Queue does modifications in place and doesn't
take the queue as the first parameter. Another example is List.nth
which does not have side-effects but takes the list as the first
parameter. And I didn't even tried to look for examples that don't
follow your rule: I was more or less randomly browsing the manual.

> If you respect this convention, the type tells you about the semantics
> :-)

It is a good convention and I'll try follow it. Thanks.

-- 
regards,
 radu
http://rgrig.idilis.ro/