Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: 2001-03-07 (08:48)
From: qrczak@k...
Subject: Re: [Caml-list] currying...
Tue, 06 Mar 2001 17:10:56 -0800, Chris Hecker <> pisze:

> >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?

It can be a function of two arguments which calls the underlying C
function. Or a function of one argument which returns a function of
one argument which calls the underlying C function. It doesn't matter.

> but I'm not sure whether I'll need to decide whether a given closure
> takes a given number of arguments.

You should not. Because it's a meaningless property. It results
from the way it was compiled, not from its meaning. Writing the same
function in slightly different ways (but equivalent ways as far as
OCaml is involved) can produce differently looking closures.

It's like taking an address of a float. You can do it because a float
is expressed as a heap-allocated objects, but you should not rely
on whether two floats have the same address, because it can depend
on compiler optimizations. It's not a property of OCaml's float type
but an artifact of the implementation.

 __("<  Marcin Kowalczyk *
  ^^                      SYGNATURA ZASTĘPCZA

To unsubscribe, mail  Archives: