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 (18:00)
From: Chris Hecker <checker@d...>
Subject: Re: [Caml-list] currying...

>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 -> ...).

Okay, that makes sense, thanks.  Now my question is, is there any way to introspect to get at the arity information?  I think it must be stored somewhere at runtime, because I can pass both f's to another function because they have the same "illusory type".  

Or do they?  Is int -> int -> int typechecked _exactly_ like int -> (int -> int)?  I assume they must be or the illusion wouldn't hold up.  I'd also assume this arity check only happens during application and doesn't affect typechecking at all.


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