caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp>
To: la@iki.fi
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Oo.id
Date: Thu, 10 Oct 2002 09:52:43 +0900	[thread overview]
Message-ID: <20021010095243S.garrigue@kurims.kyoto-u.ac.jp> (raw)
In-Reply-To: <20021008194625.GA887@la.iki.fi>

From: Lauri Alanko <la@iki.fi>
> 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


      reply	other threads:[~2002-10-10  0:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-04  0:43 james woodyatt
2002-10-04  7:58 ` Jacques Garrigue
2002-10-04 16:52   ` james woodyatt
2002-10-08 19:46   ` Lauri Alanko
2002-10-10  0:52     ` Jacques Garrigue [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021010095243S.garrigue@kurims.kyoto-u.ac.jp \
    --to=garrigue@kurims.kyoto-u.ac.jp \
    --cc=caml-list@inria.fr \
    --cc=la@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).