From: Leo Razoumov Date: 2001-03-08T07:40:02+09:00 Subject: [ruby-talk:12250] Re: FEATURE REQUEST: 'my' local variables >>>>> "GK" == GOTO Kentaro writes: GK> In message "[ruby-talk:12204] FEATURE REQUEST: 'my' local variables" GK> 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? GK> "my" seems too complex for user. I do not understand why "my" is too complex to a user. It has been in Perl for years and no one complained of its complexity. Similar semantics exists in Scheme and Lisp (let (...)) and has been in use for decades . If you do not like token "my" it can be any other name like "local", etc. Bottom line, Ruby does not have a mechanism to push an arbitrary local variable onto its local scope. And this is bad! -- Leo [slonika AT yahoo DOT com]