User loginNavigation 
Help with NAry functions?I feel incredibly silly posting this, but I could use some pointers. There seem to be two schools of function specification: one in which all function types are expressed as T1 > T2, and the other in which function types are expressed as T1 x T2 x ... Tn > Tout. The difference here is that the second makes function arity part of the type. In BitC, we initially chose the Nary functions because I was slow figuring out how to make C's void type come out right. Later, we retained it because I thought that arity checking was important. That is, given a function: (define (f x y) ...)
it seemed like a good thing to be able to notice that: (f 1 2 3)
was a malformed call because the number of arguments do not agree. The alternative was to define application to occur by pair consing (similar to Scheme style, but with using an unboxed construction): (f 1 2 3) =>
My concern about this is that type checking doesn't accomplish arity checking in the case where the type of the last parameter to the function is parametric. That is, if we get a function f whose type is something like: (int32, float, 'a) > bool
then you'll get to pass as many arguments as you want. The Nary function thing is now getting in our way, and I would like to switch to something like the pairconsed view. There seem to be three resolutions:
So: how do other polymorphic languages handle this? By shap at 20080928 23:23  LtU Forum  previous forum topic  next forum topic  other blogs  7003 reads

Browse archivesActive forum topics 
Recent comments
8 hours 48 min ago
8 hours 50 min ago
9 hours 18 min ago
16 hours 33 min ago
16 hours 36 min ago
17 hours 8 min ago
1 day 3 hours ago
1 day 4 hours ago
1 day 8 hours ago
1 day 9 hours ago