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 RAA24232; Thu, 10 Apr 2003 17:31:18 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA24117 for ; Thu, 10 Apr 2003 17:31:16 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from opus.davidb.org (66-75-152-1.san.rr.com [66.75.152.1]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h3AFVE913620 for ; Thu, 10 Apr 2003 17:31:15 +0200 (MET DST) Received: from davidb by opus.davidb.org with local (Exim 3.31 #1 (Debian)) id 193e0s-0000SD-00; Thu, 10 Apr 2003 08:30:54 -0700 Date: Thu, 10 Apr 2003 08:30:54 -0700 From: David Brown To: Jean-Christophe Filliatre , Brian Hurt , "Yaron M. Minsky" , Caml List Subject: Re: [Caml-list] Re: Wanted - General Purpose "Glue Logic" Data-Structures Message-ID: <20030410153054.GA1718@opus.davidb.org> References: <16019.49880.45938.429789@gargle.gargle.HOWL> <16021.10090.355061.746312@gargle.gargle.HOWL> <20030410103518.GA31212@mail4.ai.univie.ac.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030410103518.GA31212@mail4.ai.univie.ac.at> User-Agent: Mutt/1.4i X-Spam: no; 0.00; caml-list:01 glue:01 overwrite:01 finalizers:01 monitored:99 arrays:01 0200,:01 mottl:02 module:03 dave:03 wrote:03 dependent:03 obj:03 library:03 object:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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