Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] tree walking with... specular rec functions? what else?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-05-12 (15:06)
From: David Brown <caml-list@d...>
Subject: Re: [Caml-list] tree walking with... specular rec functions? what else?
On Mon, May 12, 2003 at 03:35:42PM +0200, Michal Moskal wrote:

>     On non-mutable structures, the behavior of (==) is
>     implementation-dependent.
> Which means that lst = [] does not imply lst == [].
> In other words, one should use:
>  	if lst = [] then empty-code else full-code
> or pattern matching, as you said.

Is it really not defined by Ocaml?  Ocaml implements the empty list as
the integer value zero.  Although (==) won't tell you if two cons-cells
have the same contents, it will tell you if they are the same.

So is there any implementation of a caml language where [] == [] isn't
always true, for any way that [] is generated?

The (=) has more overhead, and in this case, I'm not sure it is


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: