Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: 2003-10-11 (17:54)
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

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: