Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] currying...
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Chris Hecker <checker@d...>
Subject: Re: [Caml-list] currying...

>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