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: Xavier Leroy <Xavier.Leroy@i...>
Subject: Re: [Caml-list] currying...
> [Curried functions, functions returning functions, and all that]

> I have a feeling I'm missing something fundamental here, or else the
> definition of a function internally has a field for its arity and it
> just partially applies until it reaches the total arity.

This is pretty much how it works internally, although the precise
mechanisms used are slightly different in the bytecode interpreter and
in the native-code compiler.  Viewed from the outside, it maintains
the illusion that every function takes only one parameter,
and fun x y -> ... behaves like fun x -> (fun y -> ...).

- Xavier Leroy
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr