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 TAA31482; Sat, 11 Oct 2003 19:54:45 +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 TAA19950 for ; Sat, 11 Oct 2003 19:54:44 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from smtp802.mail.sc5.yahoo.com (smtp802.mail.sc5.yahoo.com [66.163.168.181]) by nez-perce.inria.fr (8.11.1/8.11.1) with SMTP id h9BHsg128473 for ; Sat, 11 Oct 2003 19:54:43 +0200 (MET DST) Received: from adsl-63-194-18-166.dsl.lsan03.pacbell.net (HELO rftp.com) (rftp@pacbell.net@63.194.18.166 with plain) by smtp-sbc-v1.mail.vip.sc5.yahoo.com with SMTP; 11 Oct 2003 17:54:41 -0000 Message-ID: <3F88440E.3050500@rftp.com> Date: Sat, 11 Oct 2003 10:55:26 -0700 From: Robert Roessler Organization: Robert's High-performance Software User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] Possible to use optional args in external (C) calls? References: <20031011132628.GA17818@redhat.com> In-Reply-To: <20031011132628.GA17818@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 ocaml-win:01 val:01 callbacks:01 labelled:01 int:01 external:03 external:03 option':96 wrote:03 latter:06 args:06 args:06 eric:06 type:07 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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