Re:Erlang Doesn’t Fit The JVM
by jonhohle on Friday April 03, 2009 @09:56AM
(#544892)
> For example: in Java, methods with the same name but different argument types ("overloaded") are statically bound; whereas in Smalltalk, they are dynamically bound.
In Smalltalk you simply have messages. An object either responds to one or it doesn't, there's no concept of overloading. A method that looks the same, but has a different number of arguments is a different method.
For example, in Java you might have a print method which takes a string, or a method with the same name which takes a format string and a variable number of replacements:
In Smalltalk you simply have messages. An object either responds to one or it doesn't, there's no concept of overloading. A method that looks the same, but has a different number of arguments is a different method.
For example, in Java you might have a print method which takes a string, or a method with the same name which takes a format string and a variable number of replacements:
Same name, different signatures.In Smalltalk, those methods would have different names:
Where the names of the methods are print: and `print:args:` respectively.Smalltalk generally closer to Python than C in terms of performance.