From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id A50827F256 for ; Wed, 7 Nov 2012 17:40:45 +0100 (CET) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of monnier.florent@gmail.com) identity=pra; client-ip=209.85.220.54; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="monnier.florent@gmail.com"; x-sender="monnier.florent@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail4-smtp-sop.national.inria.fr: domain of monnier.florent@gmail.com designates 209.85.220.54 as permitted sender) identity=mailfrom; client-ip=209.85.220.54; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="monnier.florent@gmail.com"; x-sender="monnier.florent@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-pa0-f54.google.com) identity=helo; client-ip=209.85.220.54; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="monnier.florent@gmail.com"; x-sender="postmaster@mail-pa0-f54.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AngGAOmNmlDRVdw2lGdsb2JhbABEsT2RJQJ0CCMBAQEBCQkLCRIpgh8BBScZARsSCwEDDAYFCxohIgERAQUBChIZEodlAQMPC511jDCCeIUQChknAwpZiHUBBQyNZoE9gyUDlXuBHI1HFimEEg X-IronPort-AV: E=Sophos;i="4.80,730,1344204000"; d="scan'208";a="161708560" Received: from mail-pa0-f54.google.com ([209.85.220.54]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 07 Nov 2012 17:40:44 +0100 Received: by mail-pa0-f54.google.com with SMTP id bi1so1638632pad.27 for ; Wed, 07 Nov 2012 08:40:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=0dn6/aUGGE10kDrbF6S6V645v7guOEx/pv9G88Eknys=; b=V0ghrNqpZKEB9LnDEHHerPS+BSNj5Ah9gZ7S2GEUqHCJ5bwKtxRP3V5aMVq5nOH7c0 Ws7Ff/kccWEdRjYPF4JedYG9xGTn5WJN1TW6esivDR2GHbfy3Ksg3chTSkKkEL0Jx1Lk m+qXjZDIxAzvmUmLETLLEuzh0BX/iBk6keE2vL1pubENyvdevO5UJFxSo+KrMyDbLVEA K9+i/XHZ565muHyfP0vhfuBerRQAtZUfgMpQ0jP+TZf6ZXD/GHzoB1av4xD0kcUMaTjt xKP84NAdTeYfU9xZOPF7b8AK4t9UwXlCTzq+LNbctVqd/2abHYyds8B/kRn1LQiQQiCf Z9bg== MIME-Version: 1.0 Received: by 10.68.189.233 with SMTP id gl9mr14975689pbc.166.1352306442766; Wed, 07 Nov 2012 08:40:42 -0800 (PST) Received: by 10.68.16.197 with HTTP; Wed, 7 Nov 2012 08:40:42 -0800 (PST) In-Reply-To: References: Date: Wed, 7 Nov 2012 17:40:42 +0100 Message-ID: From: Florent Monnier To: john.else@citrix.com Cc: caml-list@inria.fr, gabriel.scherer@gmail.com Content-Type: text/plain; charset=ISO-8859-1 X-Validation-by: monnier.florent@gmail.com Subject: Re: Re: [Caml-list] C binding with labelled arguments Hi, I cannot reproduce your error, for me it compiles fine: $ cat foo_stub.c foo.ml #include #include CAMLprim value stub_add_ints(value first, value second) { CAMLparam2(first, second); int sum; sum = Int_val(first) + Int_val(second); CAMLreturn(Val_int(sum)); } external add_ints : first:int -> second:int -> int = "stub_add_ints" let () = let res = add_ints ~first:3 ~second:4 in print_int res; print_newline () $ ocamlopt -o foo.opt foo.ml foo_stub.c $ ./foo.opt 7 -- 2012/11/7, john.else@citrix.com : > Hi Gabriel, > > I agree it'd be better to use labelled arguments than not, for safety as > you > suggest. I was just wondering if there was a way to add labelled arguments > directly to the external, rather than requiring a wrapper function to add > the > labels. > > John > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >