Browse thread
[Caml-list] currying...
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Sven LUTHER <luther@d...> |
| Subject: | Re: [Caml-list] currying... |
On Tue, Mar 06, 2001 at 09:41:38AM -0800, Chris Hecker wrote: > > >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. Yes, they do, int -> int -> int is just an abreviation (or parenthesing convention) of int -> (int -> int). Friendly, ven LUther ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr