Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Possible to use optional args in external (C) calls?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Robert Roessler <robert@r...>
Subject: Re: [Caml-list] Possible to use optional args in external (C) calls?
Richard Jones wrote:

> Is it possible to use optional or any labelled args in calls to C
> code? I assume that optional args are passed as 'argtype option', but
> what order do they appear to the C?

In order, yes, and as Eric says, in the "external" declaration order.

For example, the "OCaml-Win32" package from the "humps" makes use of 
both optional and labeled args.  The former show up as either 
"Val_int(0)" or a value of the type expected, while the latter are 
used in the specifications of C callbacks.

-- 
Robert Roessler
robert@rftp.com
http://www.rftp.com

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