[Gd-hackers] Required args and congruency (was Re: gtk interface: shorten identifiers, ... ?)

Andreas Bogk andreas at andreas.org
Tue Dec 5 13:18:01 CET 2006


Chris Page schrieb:
> The same way it works in some other languages. The function name plus  
> the supplied arguments determine which actual (generic) function is  
> being called. But it's primarily a conceptual distinction whether you  
> consider it to be one generic function or several, the semantics  
> could be defined to be the same (or different, if that would offer  
> some advantage).

Generic functions are first class objects.  You'd have to implement
dispatch over number of arguments in one generic function, or else code
like:

method(#rest args)
  apply(foo, args)
end

with foo being multiple generic functions will be incredibly undefined.

Having said that, I think dispatch over number of arguments sounds
useful to me.

Andreas




More information about the hackers mailing list