3 ms·
Execution in the kingdom of nouns
- schtog 18y agoThis site is really starting to repeat itself...
- biohacker42 18y agoAgreed, but I hope articles like this one work as (digg) crowd repellent.
- greyman 18y agoYes, and c++ is the dumbest language in the world...as uttered by this guy in another post. Ok, back to work...
- silentbicycle 18y agoWell, people keep reposting old Steve Yegge rants. The remedy is probably to post more interesting content and drown out them out, not just avoiding upvoting them. (Not a personal criticism.)
- stcredzero 18y agoCLOS had excellent facilities for defining functions specific to certain types, but not owned by them. Interfaces and Mix-ins are ways you can deal with this in a "noun-oriented" way. (Templates can be used like this as well.) However, if you just need a function specific to two types, why not just define a function for those types? In Smalltalk, you'd just use a block with no arguments and hopefully write Unit Tests to cover type inconsistencies. This block would have to sit around somewhere in a method where it is defined, however. Or, you could implement the #value:value: message somewhere and pretend something else is a code block. (There is a similar mechanism in Python, but I can't recall it.)