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 CAA13772; Thu, 10 Oct 2002 02:53:24 +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 CAA13921 for ; Thu, 10 Oct 2002 02:53:23 +0200 (MET DST) Received: from favie.faith.gr.jp (favie.faith.gr.jp [61.127.175.250]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g9A0rL517832 for ; Thu, 10 Oct 2002 02:53:22 +0200 (MET DST) Received: from localhost (dhcp7.faith.gr.jp [192.168.1.17]) by favie.faith.gr.jp (8.9.3/8.9.3) with ESMTP id JAA26757; Thu, 10 Oct 2002 09:53:08 +0900 To: la@iki.fi Cc: caml-list@inria.fr Subject: Re: [Caml-list] Oo.id In-Reply-To: <20021008194625.GA887@la.iki.fi> References: <44C91AD4-D732-11D6-AD63-000393BA7EBA@wetware.com> <20021004165824H.garrigue@kurims.kyoto-u.ac.jp> <20021008194625.GA887@la.iki.fi> X-Mailer: Mew version 1.94.2 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20021010095243S.garrigue@kurims.kyoto-u.ac.jp> Date: Thu, 10 Oct 2002 09:52:43 +0900 From: Jacques Garrigue X-Dispatcher: imput version 20000228(IM140) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk From: Lauri Alanko > On Fri, Oct 04, 2002 at 04:58:24PM +0900, Jacques Garrigue wrote: > > Using the address would be ok for equality, but not for compare, as > > the GC may move things around: the result of compare might change. > > Why does there need to be an ordering for objects in the first place? > This seems about as sensible as ordering closures (ie. not very). Because objects have identity and data contents, which closure don't have. You need the ordering for functors like Map or Set, and it has to be an int for Hashtbl. > Alternatively, if the stability of addresses is important, couldn't > objects be allocated in a special heap where GC would be non-copying? You might want stability of addresses for all mutable data structures, but this would also mean a much less eficient GC. As Caml is a functional language, GC speed is favored over a strong definition of physical ordering. You just have to add an id when you need it, which is not really difficult. Strictly speaking, the id could be delegated to users for objects too, but having it buitin avoids trouble with beginners. Jacques Garrigue ------------------- 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