From: Mark Hahn Date: 2001-12-30T08:58:49+09:00 Subject: [ruby-talk:29674] Re: promoting self to subclass (was extending method of class A ...) > see the thread starting at: [ruby-talk:19517] That sure was a long thread. It covered all my ideas and arguments, so I see that I lost my argument before I even thought of it . -----Original Message----- From: ruby-talk-admin@ruby-lang.org [mailto:ruby-talk-admin@ruby-lang.org]On Behalf Of David Alan Black Sent: Saturday, December 29, 2001 1:39 PM To: ruby-talk ML Subject: [ruby-talk:29654] Re: promoting self to subclass (was extending method of class A ...) Hello -- On Sat, 29 Dec 2001, Mark Hahn wrote: > Why not allow a method to "promote" it's object to a subclass of the object? > I've wanted to do this before in ruby and Java. It should be somewhat easy > in ruby and nearly impossible in a static language. [...] > Where I've run into this need is when an initializer realizes that, based on > input params, there is a more specific class for this data. Another case is > when an object is created and the "type" gets refined later. If you want a > specific example of this being used, let me know. Yes, please :-) I'm also wondering whether this is similar to the idea of a #become method. There's been a bunch of discussion on that here in the past. In particular, see the thread starting at: "[ruby-talk:19517] Why not?: Assigning to self" David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav