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

Browse archivesActive forum topics 
Recent comments
3 days 15 hours ago
1 week 6 days ago
2 weeks 6 days ago
3 weeks 1 day ago
3 weeks 1 day ago
3 weeks 2 days ago
4 weeks 6 days ago
4 weeks 6 days ago
5 weeks 15 hours ago
5 weeks 21 hours ago