In article <[EMAIL PROTECTED]>, Christoph Zwerschke <[EMAIL PROTECTED]> wrote: >>> Simon Percivall wrote: >>>> First: It's perfectly simple in Java to create a binary sort that >>>> sorts all arrays that contain objects; so wrong there. >>> My point was that the *same* Java source example, directly converted to >>> Python would *automatically* accept all kinds of arrays. >> >> And the same code converted to SML would automatically work on all >> kinds of arrays and SML is statically typed. It's a language issue, >> not a typing issue. > >Ok, here the point was that Java has *explicit* static typing. SML is >not a procedural language and uses *implicit* static typing. Therefore >it shares some of the benefits of dynamically typed languages such as >Python. However, an SML version of the program would probably still have >the same bug as the Java version, right? > >>> No need to make any extra efforts. >>> By the way, how would you do it in Java? With >>> function overloading? I would not call that perfectly simple. >> >> Since Java doesn't allow function overloading that clearly can't be >> the way. J2SE 5.0 allows generic classes and functions that operate >> on generic containers. There are some gotchas, but it's not drastically >> more complex than the original int-only java code. > >Java doesn't allow function overloading?
Brain fart. You said "function" and I read "operator". Alan -- Defendit numerus -- http://mail.python.org/mailman/listinfo/python-list