caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: art yerkes <ayerkes@speakeasy.net>
To: caml-list@inria.fr
Subject: [Caml-list] Using -dtypes output in conjunction with a preprocessor
Date: Fri, 22 Aug 2003 02:39:49 -0500	[thread overview]
Message-ID: <20030822023949.16fae994.ayerkes@speakeasy.net> (raw)

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


             reply	other threads:[~2003-08-22  7:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-22  7:39 art yerkes [this message]
2003-08-22  9:05 ` Michal Moskal
2003-08-22 14:27   ` art yerkes
2003-08-24 15:14 ` [Caml-list] GlSurf 2.0 Christophe Raffalli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030822023949.16fae994.ayerkes@speakeasy.net \
    --to=ayerkes@speakeasy.net \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).