From: gotoken@... (GOTO Kentaro) Date: 2001-03-07T16:13:37+09:00 Subject: [ruby-talk:12215] Re: FEATURE REQUEST: 'my' local variables In message "[ruby-talk:12204] FEATURE REQUEST: 'my' local variables" on 01/03/07, Leo Razoumov writes: ># PROPOSED FEATURE: >x = 0 #line_1 >{ > my x = 7 # new varible 'x' shadowing 'x' from line_1 > x # -> 7 >} >x # -> 0 > > >I guess it should not be hard to add this functionality to the language. >Any thoughts? "my" seems too complex for user. But I think some shadowing mechanism for an instance variable is helpful because we have to choose carefully name of an instance variable when we define a subclass with new features. If name collision is occur, the super class's functions would not work. -- Gotoken