From: Ryan Pavlik Date: 2003-11-09T10:36:42+09:00 Subject: Re: Managing metadata about attribute types On Sun, 9 Nov 2003 10:07:50 +0900 dblack@wobblini.net wrote: > On Sun, 9 Nov 2003, Ryan Pavlik wrote: > > As in the previous post, this is possible, but there is no incentive > > to do so. If you want to break your own code, there are quicker and > > easier ways. > > You must not be a big fan of class methods :-) I'm not sure what your point is here. The only conceivable point I can see is that class methods are singleton objects of type Class, and that if I ask for a Class, I may get one, but it won't be the exact API of Class if I use class methods. You're probably just trying to be funny---which is fine---but the joke does overlook a few points I've made, including the one you pasted beneath. Adding methods does not break type checking. An extended object is still the object you wanted. (Overriding and replacing an existing class method might break something, but this is my point in the above quote---there's not a lot of incentive to break things.) This is coupled with a previous point: you will never ask specifically for something you don't know about. For instance, your code might ask for a Foo, but if it doesn't know about a Bar, a subclass of Foo, it will not ask for it. Singletons fall under this; they are still their original class, but with things added. (Of course you _can_ remove or incompatibly redefine things. This is usually bad. For instance, when CGI used to return singleton Strings with #[] redefined in an incompatible manner without any information on the fact. This caused a lot of problems.) Anyway, you will obviously never accept my position, and I've had too much success with strongtyping to give it up, so add any closing points you wish to make and let's wrap this one up so we can get back to doing something productive... like writing ruby code. ;-) -- Ryan Pavlik "You're about a thousand miles of *wrong*." - 8BT