From: Simon Strandgaard Date: 2004-03-08T19:19:41+09:00 Subject: Re: proposal: class< on 04/03/08, Simon Strandgaard writes: > |> Describe yourself deeper. What exactly is your proposal? > | > |When 'class< |I propose to reuse #extend_object and #extended for this. > | > |> And why do you think it's needed? > | > |Its difficult to add an new instance variable to obj. > |Its inflexible compared to obj.extend(Mod), because there isn't > |invoked an #extend_object method when the extension occurs. > > You didn't explain why you need "extended" for singleton class > definition. Why don't you use extend for your purpose, before > changing the language? I don't have a serious need for 'class< |> Remember, since singleton class always exists for each object > |> (virtually), 'class < | > |I am only little familiar with class re-opening.. > > I want you to take a break and learn about Ruby before claiming apples > and oranges are similar. Yes, they are. But not the same. Besides > that, singleton class definition is a kind of class re-opening, so > that they should remain same. Ok, I am learning every day ;-) > Class re-opening is a class definition whose target is an existing > class, for example: > > class String > def foo # String#foo become available > end > end > > there's no hook for class re-opening. > I wasn't sure about what kind of reopening you talked about in last mail. Yes, I have used this a few times. However I am only interested in modifying a specific instance with 'class<