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 DAA16326; Thu, 14 Aug 2003 03:55:59 +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 DAA04412 for ; Thu, 14 Aug 2003 03:55:57 +0200 (MET DST) 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 h7E1ttf09770 for ; Thu, 14 Aug 2003 03:55:56 +0200 (MET DST) Received: from localhost (suiren.kurims.kyoto-u.ac.jp [130.54.16.25]) by kurims.kurims.kyoto-u.ac.jp (8.9.3p2/3.7W) with ESMTP id KAA17295; Thu, 14 Aug 2003 10:55:51 +0900 (JST) To: cdutchyn@cs.ubc.ca Cc: caml-list@pauillac.inria.fr Subject: Re: [Caml-list] Obj.magic, Obj.t etc. In-Reply-To: References: 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: <20030814105551S.garrigue@kurims.kyoto-u.ac.jp> Date: Thu, 14 Aug 2003 10:55:51 +0900 From: Jacques Garrigue X-Dispatcher: imput version 20000228(IM140) X-Loop: caml-list@inria.fr X-Spam: no; 0.00; jacques:01 caml-list:01 ubc:99 catchall:99 incorrectly:01 interfacing:01 val:01 abstr:01 subtyping:01 ocaml:01 garrigue:01 segmentation:01 typechecker:02 module:03 macros:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk From: Christopher Dutchyn > In a few instances I've encountered code with these special types. > The former appears to be a way to "hint" the typechecker with > additional information, and the latter seems to be some sort of > catchall. > > Where are these documented? Are there any others? Related functions are all in the Obj module. They are not documented as ML function because almost all of them can break type safety when used incorrectly. On the other hand, they are just equivalent to C macros described in the "interfacing C" part of the manual, so you can consider this as documentation. As an interesting aside, I've discovered recently that even Obj.repr is dangerous: # Obj.repr;; - : 'a -> Obj.t = # let arr = Array.create 1 (Obj.repr 1.0);; val arr : Obj.t array = [||] # arr.(0) <- Obj.repr 1;; Segmentation fault >>From a subtyping point of view, this basically means that there cannot be any "top" element in the ocaml type system. 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