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 UAA13673; Fri, 11 Oct 2002 20:35:27 +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 UAA13751 for ; Fri, 11 Oct 2002 20:35:26 +0200 (MET DST) Received: from relay.pair.com (relay1.pair.com [209.68.1.20]) by concorde.inria.fr (8.11.1/8.11.1) with SMTP id g9BIZP506746 for ; Fri, 11 Oct 2002 20:35:25 +0200 (MET DST) Received: (qmail 75197 invoked from network); 11 Oct 2002 18:35:21 -0000 Received: from node-d8e9cca2-sfo-onnet.worldcom.com (HELO checkerlap.d6.com) (216.233.204.162) by relay1.pair.com with SMTP; 11 Oct 2002 18:35:21 -0000 X-pair-Authenticated: 216.233.204.162 Message-Id: <4.3.2.7.2.20021011112904.01b300f0@mail.d6.com> X-Sender: checker@mail.d6.com X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Date: Fri, 11 Oct 2002 11:35:25 -0700 To: Jean-Christophe.Filliatre@lri.fr (Jean-Christophe Filliatre), Alain Frisch From: Chris Hecker Subject: "custom" operators in caml (was: Re: [Caml-list] Num library) Cc: Caml list In-Reply-To: <15782.56161.649922.825529@pc8-123> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >when nums are involved within huge datatypes, you have to write >structural comparison and hash functions for these types. This is a >pain, really. This brings up a general issue: from the C side you can create custom blocks that have hooks for various operators (finalize,compare,hash,serialize). Is there any way to do this from the ml side? In other words, if you could hook into the num block somehow and register these operators in caml that would allow you do embed them in datastructures and use =, and the runtime would call eq_num. Of course, you don't want the whole block to be custom, because you want ocaml to scan it in the gc and you want it to be able to be operated on in caml. I assume there's no way to do this, since you'd need a new block type, and there are no more tags left without lowering No_scan_tag, which would break everything (or at least anything that has a big constant variant), I assume. But I don't know. Just another thought in my continuing desire to be able to do everything without dropping to C... Chris ------------------- 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