News for hackers. Stuff that matters.
Re:The Brittleness Of Type Hierarchies by gchpaco on Tuesday May 08, 2012 @02:20PM (#3945111)
This problem is easily resolved by noting that you think the method has to 'belong' to one type or another instead of exist as a first class object of its own. In practice this was done first in Lisp (the 'generic function' works better with typical Lisp environments than endless (send object message) calls, in particular with functions like map), and then the fact that the generic function treated one and only one argument specifically was noticed. From here we get multiple dispatch in a very natural way, a concept that is quite awkward in a language like Smalltalk.
Re:The Brittleness Of Type Hierarchies by danssig on Wednesday May 09, 2012 @04:17AM (#3947563)
The concept is quite awkward in any single dispatch language. The biggest WTF ever is Racket adding single dispatch OO! You actually have to say (send object 'message).