From: Marcin 'Qrczak' Kowalczyk Date: 2003-09-26T18:18:32+09:00 Subject: Re: Adding, removing and redefining features at runtime W li�cie z pi�, 26-09-2003, godz. 03:04, Thomas Sondergaard pisze: > Most modern languages including ruby has introduced > namespaces to alleviate the namespace collision problem, but the convention > of adding your own methods to existing classes reintroduces the problem. > > Is ruby merely being pragmatic by allowing you to do this, because it seldom > causes any real problems? Or is it inherently wrong and should not be > permitted by the language/object model? For me it's essential that you can add new generic functions which dispatch on old types, and that you can add new types on which old generic functions dispatch. I refuse to like languages which don't allow both. It's not essential that the language is object oriented though, and I don't like being forced to put a name into a shared namespace. The traditional OO style also allows to dispatch on one parameter only. So, in Ruby it's an essential feature with a bad side effect. I don't like how it is done (that you "add a method to a class" and risk name clashes), but it's great that it can be done at all. Languages which can do both without the namespace issue: Lisp (CLOS), Dylan, and to some extent Haskell, Clean and Mercury (where the dispatch is limited and usually can be resolved statically). -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/