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 MAA25258; Wed, 29 Oct 2003 12:39:46 +0100 (MET) 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 MAA11269 for ; Wed, 29 Oct 2003 12:39:45 +0100 (MET) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h9TBdh120280 for ; Wed, 29 Oct 2003 12:39:44 +0100 (MET) Received: from localhost (suiren.kurims.kyoto-u.ac.jp [130.54.16.25]) by kurims.kurims.kyoto-u.ac.jp (8.9.3p2-20030924/3.7W) with ESMTP id UAA28591; Wed, 29 Oct 2003 20:39:36 +0900 (JST) To: zack@bononia.it Cc: caml-list@inria.fr Subject: Re: [Caml-list] undocumented external ... = "%identity" In-Reply-To: <20031029104248.GA6566@fistandantilus.takhisis.org> References: <20031029104248.GA6566@fistandantilus.takhisis.org> 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: <20031029203935I.garrigue@kurims.kyoto-u.ac.jp> Date: Wed, 29 Oct 2003 20:39:35 +0900 From: Jacques Garrigue X-Dispatcher: imput version 20000228(IM140) X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 undocumented:01 jacques:01 bononia:01 undocumented:01 200208:01 lablgtk:01 interfacing:01 disappears:01 jacques:01 unsafe:01 ocaml:01 caml:01 caml:01 garrigue:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk From: Stefano Zacchiroli > It seems to me that the "%identity" feature, as in > > external unsafe_cast : 'a obj -> 'b obj = "%identity" > > is undocumented. Am I wrong? If not is there any particular reason for > so? According to http://caml.inria.fr/archives/200208/msg00034.html is > not meant to be used by the end user, but if it's better than Obj.magic > and used by lablgtk I see no reason to not mention it in the > "Interfacing C with Objective Caml" chapter of the OCaml documentation. > Maybe with a huge disclaimer ... It is equivalent to Obj.magic, which uses the same external. The only interest is that you can choose to give it a type more restrictive than Obj.magic, while still being an external. This way %identity completely disappears during compilation. I suppose that as Obj.magic is not documented, this is not documented either. 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