caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Using -dtypes output in conjunction with a preprocessor
@ 2003-08-22  7:39 art yerkes
  2003-08-22  9:05 ` Michal Moskal
  2003-08-24 15:14 ` [Caml-list] GlSurf 2.0 Christophe Raffalli
  0 siblings, 2 replies; 4+ messages in thread
From: art yerkes @ 2003-08-22  7:39 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-08-24 14:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-22  7:39 [Caml-list] Using -dtypes output in conjunction with a preprocessor art yerkes
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

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).