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  6786 reads

Browse archives
Active forum topics 
Recent comments
4 hours 44 min ago
8 hours 4 min ago
9 hours 38 min ago
14 hours 28 min ago
16 hours 26 min ago
19 hours 6 min ago
20 hours 47 min ago
21 hours 4 min ago
21 hours 16 min ago
1 day 8 hours ago