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 BAA23573; Wed, 7 Mar 2001 01:21:10 +0100 (MET) 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 BAA23691 for ; Wed, 7 Mar 2001 01:21:06 +0100 (MET) Received: from mail.mimuw.edu.pl (pm211.warszawa.cvx.ppp.tpnet.pl [213.76.108.211]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f270KkD28160 for ; Wed, 7 Mar 2001 01:20:47 +0100 (MET) Received: (from news@localhost) by mail.mimuw.edu.pl (PLD/8.9.3) id AAA02460 for caml-list@inria.fr; Wed, 7 Mar 2001 00:45:50 +0100 X-Authentication-Warning: qrnik.zagroda: news set sender to qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk) using -f From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk) Subject: Re: [Caml-list] currying... Date: 6 Mar 2001 23:45:47 GMT Organization: Klub Nieszkodliwych =?iso-8859-2?Q?Manjak=F3w?= Message-ID: References: <4.3.2.7.2.20010306012957.00c7cf00@shell16.ba.best.com> <4.3.2.7.2.20010306012957.00c7cf00@shell16.ba.best.com> <4.3.2.7.2.20010306093019.00e181f0@shell16.ba.best.com> <4.3.2.7.2.20010306120843.037813b0@shell16.ba.best.com> <4.3.2.7.2.20010306150210.037887a0@shell16.ba.best.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 8bit X-Trace: qrnik.zagroda 983922347 2458 192.168.0.1 (6 Mar 2001 23:45:47 GMT) X-Complaints-To: news@qrnik.zagroda NNTP-Posting-Date: 6 Mar 2001 23:45:47 GMT User-Agent: slrn/0.9.6.3 (Linux) To: caml-list@inria.fr Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Tue, 06 Mar 2001 15:23:50 -0800, Chris Hecker pisze: > - the library needs to know whether this is "int (*)(int,int,int)" > or "int (*(*)(int))(int)" (or something else) So you have to tell it (by some other mean than OCaml's type alone). It has nothing to do with physical arity of OCaml's function closures. It describes a C type. > so that it can create a closure to pass back to caml that has the > right physical arity No, it needs not to create an OCaml closure of any particular arity. It must create a closure which behaves in a particular way: calls the C function after it received the necessary number of arguments. It doesn't matter what is the arity from OCaml's internals' point of view. You can't in general let the original C function pointer mimic OCaml's code pointer in a closure anyway. First of all, types of values will be different: C has a wide variety of types, OCamls wraps everything as either a pointer or a tagged integer. > Since this is all happening dynamically, I need to be able to deduce > the physical arity of the functions at runtime. Deduce from what? I understood that you create an OCamls function, not examine it! -- __("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/ \__/ ^^ SYGNATURA ZASTĘPCZA QRCZAK ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr