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.4 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 discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 5A7A6BC69 for ; Mon, 11 Jun 2007 02:58:50 +0200 (CEST) Received: from rabbit.math.nagoya-u.ac.jp (rabbit.math.nagoya-u.ac.jp [133.6.130.5]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l5B0wmR7023351 for ; Mon, 11 Jun 2007 02:58:49 +0200 Received: from localhost (rabbit-172 [172.16.254.254]) by rabbit.math.nagoya-u.ac.jp (8.12.11/3.7W) with ESMTP id l5B0wZhc016797; Mon, 11 Jun 2007 09:58:35 +0900 (JST) Date: Mon, 11 Jun 2007 09:58:35 +0900 (JST) Message-Id: <20070611.095835.2004157669.garrigue@math.nagoya-u.ac.jp> To: joelr1@gmail.com Cc: jtbryant@valdosta.edu, caml-list@yquem.inria.fr Subject: Re: [Caml-list] camlp4 and class introspection From: Jacques GARRIGUE In-Reply-To: <7C9995D9-AC11-4E7C-8477-25CA4B88A0F4@gmail.com> References: <7C9995D9-AC11-4E7C-8477-25CA4B88A0F4@gmail.com> X-Mailer: Mew version 4.2 on Emacs 21.4 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 466C9E48.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; camlp:01 camlp:01 inference:01 runtime:01 runtime:01 mli:01 ocamlc:01 mli:01 2007,:98 wrote:01 caml-list:01 variables:02 parse:02 garrigue:03 garrigue:03 From: Joel Reymont > On Jun 10, 2007, at 1:14 AM, Jonathan Bryant wrote: > > > I don't think this would be possible since CamlP4 happens before > > type inference and therefore knows nothing about types. > > That's really too bad. I was thinking of recognizing that type X was > used for instance variables, for example, and generating code to > register these appropriately with the Objective-C runtime. I don't know which classes you want to register with the Objective-C runtime, but an option is to require users to write .mli files (not too hard since they can be generated with ocamlc -i). Then you can use camlp4 to parse the .mli and generate the registration code to be included in the .ml file. You just have to be careful about "open" statements. Jacques Garrigue