From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 7E331BC29 for ; Tue, 29 Aug 2006 15:32:21 +0200 (CEST) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k7TDWJxM012937 for ; Tue, 29 Aug 2006 15:32:20 +0200 Received: from localhost (orion [130.54.16.5]) by kurims.kurims.kyoto-u.ac.jp (8.13.7/8.13.7) with ESMTP id k7TD5FbG010858; Tue, 29 Aug 2006 22:05:16 +0900 (JST) Date: Tue, 29 Aug 2006 22:05:11 +0900 (JST) Message-Id: <20060829.220511.27011347.garrigue@math.nagoya-u.ac.jp> To: micha-1@fantasymail.de Cc: caml-list@inria.fr Subject: Re: [Caml-list] native values in objects from c From: Jacques Garrigue In-Reply-To: <20060829115002.108020@gmx.net> References: <20060829115002.108020@gmx.net> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 44F441E3.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; val:01 caml-list:01 strings:01 int:01 int:01 native:02 objects:02 garrigue:03 garrigue:03 jacques:03 jacques:03 let:03 repr:04 repr:04 nagoya-u:04 From: "Michael Wohlwend" > with that code: > > class x = object > val name = "hoho" > end;; > > let ho = new x in ... > > > how do I access the field name form C? > > The docu says it should be the third field of the block, but that doesn't work for me (it has Tag 0, not 252 for strings ...) Well, since fields start at 0, the 3rd field is number 2. # Obj.size (Obj.repr ho);; - : int = 3 # Obj.tag (Obj.field (Obj.repr ho) 2);; - : int = 252 Jacques Garrigue