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 CAA24696; Wed, 7 Mar 2001 02:10:20 +0100 (MET) 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 CAA24526 for ; Wed, 7 Mar 2001 02:10:19 +0100 (MET) Received: from smtp2-cm.mail.eni.net (smtp2-cm.mail.eni.net [216.133.226.135]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f271AID28548 for ; Wed, 7 Mar 2001 02:10:18 +0100 (MET) Received: from checkerlap.d6.com (node-d8e9cca2.powerinter.net [216.233.204.162]) by smtp2-cm.mail.eni.net (8.9.3/8.9.3) with ESMTP id RAA27459; Tue, 6 Mar 2001 17:10:11 -0800 Message-Id: <4.3.2.7.2.20010306170714.03787b40@shell16.ba.best.com> X-Sender: def6@shell16.ba.best.com X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Date: Tue, 06 Mar 2001 17:10:56 -0800 To: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk), caml-list@inria.fr From: Chris Hecker Subject: Re: [Caml-list] currying... In-Reply-To: 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="us-ascii" Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >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. Isn't this the same thing? How is it different? > 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. I'll convert all the arguments, so that shouldn't be a problem. >> 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! Right. Since I haven't written the code yet, I'm not 100% sure exactly which primitives I'll need. I definitely need to be able to create a int -> int -> (int -> int) and an int -> int -> int -> int, but I'm not sure whether I'll need to decide whether a given closure takes a given number of arguments. I'm trying to piece together all the tools I'll need to make this work, and I'm feeling out the various corners of the problem to see where there might be problems... Chris ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr