From: transfire@... Date: 2006-07-14T10:29:22+09:00 Subject: Re: "Self" Reference Nathan Olberding wrote: > Is it possible to define new classes that behave like standard datatypes > when an instance is referred to? For example: > > class ListOfBuddies > def initialize > self = [] > self.push(Guy.new(name)) > end > end > buddy_list = ListOfBuddies.new > . > . > . > buddy_list[0].type == Guy > > Is this possible? My word, the possibilites if you could! You could change an object's "class" on the fly, hence easy implemention "roles". I think of this as the "soul" of an object. What are other implications of soul shifting? T.