Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: David Brown <caml-list@davidb.org>
To: Jean-Christophe Filliatre <Jean-Christophe.Filliatre@lri.fr>,
	Brian Hurt <brian.hurt@qlogic.com>,
	"Yaron M. Minsky" <yminsky@CS.Cornell.EDU>,
	Caml List <caml-list@inria.fr>
Subject: Re: [Caml-list] Re: Wanted - General Purpose "Glue Logic" Data-Structures
Date: Thu, 10 Apr 2003 08:30:54 -0700	[thread overview]
Message-ID: <20030410153054.GA1718@opus.davidb.org> (raw)
In-Reply-To: <20030410103518.GA31212@mail4.ai.univie.ac.at>

On Thu, Apr 10, 2003 at 12:35:19PM +0200, Markus Mottl wrote:

> There is one problem with this: you still need to fill in an object. If
> you use one provided by the user, this will consume memory dependent
> on the object size. Therefore, it is usually best to overwrite the
> slot using evil "Obj.magic" inside of the library. Note that there may
> also be finalizers associated with the value or it may be monitored by
> weak arrays.

If you fill with an object provided by the user (a special empty object)
there will only be one of them.  It's still tacky, since to use it, you
have to think of the smallest element of your type.

For something I recently did, I ended up using evil "Obj.magic" to make
the module easier to use.  Thanks to the RES example.

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


  reply	other threads:[~2003-04-10 15:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-20  2:33 [Caml-list] " John Gerard Malecki
2003-03-20 16:53 ` Brian Hurt
2003-03-20 17:36 ` Matthew W. Boyd
2003-03-24  6:08 ` Nicolas Cannasse
2003-04-08  0:59 ` [Caml-list] " Wheeler Ruml
2003-04-08  9:12   ` Markus Mottl
2003-04-08 12:03     ` Yaron M. Minsky
2003-04-09  6:51       ` Jean-Christophe Filliatre
2003-04-09 18:12         ` Brian Hurt
2003-04-10  8:12           ` Jean-Christophe Filliatre
2003-04-10 10:35             ` Markus Mottl
2003-04-10 15:30               ` David Brown [this message]
2003-04-10 15:03             ` Brian Hurt
2003-04-08 15:07   ` Brian Hurt
2003-04-08 16:38     ` John Gerard Malecki

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=20030410153054.GA1718@opus.davidb.org \
    --to=caml-list@davidb.org \
    --cc=Jean-Christophe.Filliatre@lri.fr \
    --cc=brian.hurt@qlogic.com \
    --cc=caml-list@inria.fr \
    --cc=yminsky@CS.Cornell.EDU \
    /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