On Sat, 30 Oct 2010, Sean P. DeNigris wrote:
snip
I was thinking how beautiful this code could be if each class had it's own encode method, like: In method protocol *xmlrpc Symbol>>encodeForXmlRpc String>>encodeForXmlRpc etc.
BONUS: if this was the case, extending for new types would be ridiculously trivial - just add the method to the type instead of trying to hook into large control structures, e.g.
- so that a Symbol on the ST end is recognized as a Symbol on the Ruby side
(ends up as a string right now) *so that I can talk to remote Ruby objects
OTOH, I was concerned about cluttering the core classes. I've been going back and forth with this kind of thing since I came to Smalltalk, never got it resolved.
What do you think?
I agree with you. :) Core classes won't be cluttered, because you'll add only 1-2 methods to a separate method category. Btw XML-RPC is so simple that it could be reimplemented in an hour.
Levente
Thanks. Sean -- View this message in context: http://forum.world.st/OOP-Question-adding-methods-to-core-classes-tp3020788p... Sent from the Squeak - Beginners mailing list archive at Nabble.com. _______________________________________________ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners