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

Browse archivesActive forum topics
New forum topics

Recent comments
4 days 7 hours ago
6 days 1 hour ago
2 weeks 3 days ago
3 weeks 2 days ago
4 weeks 2 days ago
6 weeks 8 hours ago
6 weeks 3 days ago
7 weeks 4 days ago
8 weeks 10 hours ago
8 weeks 14 hours ago