From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id D6099BBAF for ; Mon, 15 Feb 2010 11:15:19 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqwBAK+teEvUGyoBkWdsb2JhbACDBZgWFQEBAQEJCwoHEwMgrDKOUIEwglBbBA X-IronPort-AV: E=Sophos;i="4.49,475,1262559600"; d="scan'208";a="44659445" Received: from smtp1-g21.free.fr ([212.27.42.1]) by mail2-smtp-roc.national.inria.fr with ESMTP; 15 Feb 2010 11:15:19 +0100 Received: from smtp1-g21.free.fr (localhost [127.0.0.1]) by smtp1-g21.free.fr (Postfix) with ESMTP id A2E799401BC for ; Mon, 15 Feb 2010 11:15:14 +0100 (CET) Received: from localhost.localnet (88-123-240-105.rev.libertysurf.net [88.123.240.105]) by smtp1-g21.free.fr (Postfix) with ESMTP id C05FC9401F9 for ; Mon, 15 Feb 2010 11:15:11 +0100 (CET) From: Florent Monnier To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Wrapping var_args, or C ... in ocaml? Date: Mon, 15 Feb 2010 11:16:00 +0100 User-Agent: KMail/1.12.2 (Linux/2.6.31.12-desktop586-1mnb; KDE/4.3.2; i686; ; ) References: <4B781ACC.4040603@citycable.ch> <20100214180650.GA22433@annexia.org> <4B787D32.10505@citycable.ch> In-Reply-To: <4B787D32.10505@citycable.ch> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <201002151116.00907.fmonnier@linux-nantes.fr.eu.org> X-Spam: no; 0.00; ocaml:01 guillaume:01 varargs:01 ocaml:01 vrier:98 10,:98 caml-list:01 seems:03 gnu:03 args:05 long:06 arguments:07 arguments:07 function:08 mean:08 Le dimanche 14 f=C3=A9vrier 2010 23:46:10, Guillaume Yziquel a =C3=A9crit : > I mean, it seems that varargs means on the receiving end "the number of=20 > arguments you'r giving me, as a function, is not limited", whereas on=20 > the sending end, you hard-code the number of arguments in your C code. >=20 > Is there a way to map an OCaml list to an ellipsis? Or is it a C > limitation? Yes, as long as I know, for this you should use these kind of tools: http://sourceware.org/libffi/ http://www.gnu.org/software/libffcall/ http://www.nongnu.org/cinvoke/ http://dyncall.org/ =2D-=20