Hi,

2009/7/19 Shugo Maeda <shugo / ruby-lang.org>:
> I created a patch on Friday:
>
> =A0http://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. =A0In that talk,
> I will propose another feature to specify explicit scope. =A0It is
> implemented by just 6 lines in C.

I proposed Kernel#let.

    x, y =3D 0, 1
    let {|x, y =3D 2|
      x =3D 3
      p y   #=3D> 2
    }
    p x     #=3D> 0
    p y     #=3D> 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?

--=20
Shugo Maeda