From: Matthew Moss Date: 2006-01-26T05:15:53+09:00 Subject: Re: Metaclass confusion Heh heh, shouldn't that first line be: Song = Object.clone ? On 1/25/06, Jules Jacobs wrote: > A non-circular model would be prototype based inheritance. You just > clone things to subclass them: > > Song = Object.new > > Song.attr_writer :title > Song.title = 'No title set' > > Song.define_method :play > puts "Playing #{@title}" > end > > a_song = Song.clone > a_song.title = 'Song one' > a_song.play > > another_song = Song.clone > another_song.title = 'Song two' > > subclass_of_a_song = a_song.clone > subclass_of_a_song.play > > Then there is no distinction between class/object. This is how > Javascript does it, and it seems a good solution. > > But we have a class based model, not so clean, but acceptable ;-) > > Jules > > -- > Posted via http://www.ruby-forum.com/. > >