English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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-06 (16:31)
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