[Gd-hackers] gtk interface: shorten identifiers, ... ?

Andreas Bogk andreas at andreas.org
Tue Nov 28 22:18:08 CET 2006


Danny Milosavljevic schrieb:
>>> It works, except for the case where the number of arguments varies.
>> Hmm, that needs special handling, then...
> On second thought, waait a minute. 
> Does that mean it doesn't support "overloading" properly? 

Dylan has no idea that a thing called "overloading" even exists.

> I mean its a nice idea to have classes not introduce their own namespace
> (since that can be found out by the argument types), but all the methods of
> different objects which coincidencially had the same name would need to
> have the same number of arguments as well? That's pretty improbable :)

And it doesn't work like that at all. :)  First of all, objects don't
have methods in Dylan.  You have objects, and you have generic
functions.  I know this is the part that is the hardest to understand
for somebody new to the language, but you should try.

Now for a generic function, all methods of that function need to have
congruent argument lists, which means: same number of parameters.  You
can have multiple generic functions with the same name though, as long
as they live in different modules.  If you want to use both of them in
the same module, you have to rename one on import.

Andreas




More information about the hackers mailing list