From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA24733; Mon, 12 May 2003 17:06:37 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA25302 for ; Mon, 12 May 2003 17:06:35 +0200 (MET DST) Received: from opus.davidb.org (66-75-152-1.san.rr.com [66.75.152.1]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h4CF6YH00594 for ; Mon, 12 May 2003 17:06:34 +0200 (MET DST) Received: from davidb by opus.davidb.org with local (Exim 3.31 #1 (Debian)) id 19FEsR-0005iR-00; Mon, 12 May 2003 08:06:07 -0700 Date: Mon, 12 May 2003 08:06:07 -0700 From: David Brown To: Michal Moskal Cc: John Carr , Brian Hurt , caml-list@inria.fr Subject: Re: [Caml-list] tree walking with... specular rec functions? what else? Message-ID: <20030512150607.GA21915@opus.davidb.org> References: <200305121257.IAA29080@nerd-xing.mit.edu> <20030512133542.GA9977@roke.freak> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030512133542.GA9977@roke.freak> User-Agent: Mutt/1.4i X-Spam: no; 0.00; caml-list:01 michal:01 moskal:01 non-mutable:01 implements:01 ocaml:01 caml:01 rec:01 0200,:01 imply:02 tree:02 overhead:03 dave:03 wrote:03 behavior:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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 necessary. Dave ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners