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 JAA03019; Fri, 22 Aug 2003 09:32:40 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA04379 for ; Fri, 22 Aug 2003 09:32:39 +0200 (MET DST) Received: from mail.speakeasy.net (mail11.speakeasy.net [216.254.0.211]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h7M7WcT05430 for ; Fri, 22 Aug 2003 09:32:38 +0200 (MET DST) Received: (qmail 1733 invoked from network); 22 Aug 2003 07:32:35 -0000 Received: from unknown (HELO apprentice.genxnet.com) ([64.81.145.152]) (envelope-sender ) by mail11.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 22 Aug 2003 07:32:35 -0000 Date: Fri, 22 Aug 2003 02:39:49 -0500 From: art yerkes To: caml-list@inria.fr Subject: [Caml-list] Using -dtypes output in conjunction with a preprocessor Message-Id: <20030822023949.16fae994.ayerkes@speakeasy.net> X-Mailer: Sylpheed version 0.8.11 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; yerkes:01 ayerkes:01 ocamlc:01 camlp:01 marshalling:01 endline:01 swig:01 foo:01 endline:01 foo:01 compiler:01 ocaml:01 ocaml:01 speakeasy:01 overloading:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk While I know it's not really intended for this, I've been giving some thought to streamlining SWIG's Ocaml support. To this end, I notice that -dtypes has been added to ocamlc in order to support type browsing in emacs. What I'm interested in finding out is if this output is expected to be stable, or if there is another way to get this sort of deep type information from a source file. I intend to use this information as hints to a camlp4 module that will recognize and rewrite references to C++ externals in order to emulate C++ style overloading. As far as I can see, I will need the ocaml compiler to tell me what type is expected for a certain application, then insert marshalling code that produces and consumes the types indicated in the hint. For example, I might produce: let _ = print_endline (string_of_int (get_int (__swig__wrapped_foo (C_list [(C_int a) (C_int b)])) from: let _ = print_endline (string_of_int (foo 1 2)) Given that the detected type of foo will be "int -> int -> int" Is using the -dtypes output the best way to get the right info? -- "Should array indices start at 0 or 1? My compromise of 0.5 was rejected without, I thought, proper consideration." - S. Kelly-Bootle ------------------- 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