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 RAA14638; Sat, 11 Oct 2003 17:11:52 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA13697 for ; Sat, 11 Oct 2003 17:11:51 +0200 (MET DST) Received: from ux9.sp.cs.cmu.edu (UX9.SP.CS.CMU.EDU [128.2.220.166]) by concorde.inria.fr (8.11.1/8.11.1) with SMTP id h9BFBo122600 for ; Sat, 11 Oct 2003 17:11:50 +0200 (MET DST) Received: from 12-203-149-172.client.attbi.com ([12.203.149.172]) by ux9.sp.cs.cmu.edu id aa24045; 11 Oct 2003 11:10 EDT Received: from ecc by stratocaster.home with local (Exim 3.36 #1 (Debian)) id 1A8LNs-0005q1-00 for ; Sat, 11 Oct 2003 11:10:20 -0400 Date: Sat, 11 Oct 2003 11:10:20 -0400 To: caml-list@inria.fr Subject: Re: [Caml-list] Possible to use optional args in external (C) calls? Message-ID: <20031011151020.GA22389@ecooper.com> Mail-Followup-To: caml-list@inria.fr References: <20031011132628.GA17818@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031011132628.GA17818@redhat.com> User-Agent: Mutt/1.5.4i From: "Eric C. Cooper" X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 -dlambda:01 compiler:01 ocaml:01 labelled:01 labelled:01 external:03 external:03 option':96 wrote:03 oct:03 arguments:03 parameters:05 args:06 args:06 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sat, Oct 11, 2003 at 02:26:28PM +0100, 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? The compiler accepts "external" declarations with labelled and optional parameters, and a little experimentation with "ocaml -dlambda" shows that the external function is called with the arguments in the order specified by the "external" declaration. -- Eric C. Cooper e c c @ c m u . e d u ------------------- 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