From: Shugo Maeda Date: 2009-07-24T01:00:02+09:00 Subject: [ruby-core:24533] Re: lvar_propagate Hi, 2009/7/19 Shugo Maeda : > I created a patch on Friday: > > �http://shugo.net/RubyKaigi/2009/no-implicit-lexical-scope.diff The presentation slides are available at: http://shugo.net/RubyKaigi/2009/slide.pdf I'm not serious about magic comment. It's just a hack for the presentation. However, I prefer flat local variable scope rather than local variable propagation. Local variable propagation looks too complex because there is no lexical difference between a local variable reference and an invocation of the method which name is same to the local variable. It may be more implicit than the current behavior. > I will talk about it in RubyKaigi2009 from 16:00 today. �In that talk, > I will propose another feature to specify explicit scope. �It is > implemented by just 6 lines in C. I proposed Kernel#let. x, y = 0, 1 let {|x, y = 2| x = 3 p y #=> 2 } p x #=> 0 p y #=> 1 Thanks to the changes of block parameters in Ruby 1.9, you can specify the initial value of them. It looks like Lisp, doesn't it? -- Shugo Maeda