Hello,

2011/10/19 Joshua Ballanco <jballanc / gmail.com>:
> For example, should this work:
> =A0 =A0 x =3D 30
> =A0 =A0 def foo(a: 1, b: 2, c: x)
> =A0 =A0 =A0 =A0 puts [a, b, c]
> =A0 =A0 end
> =A0 =A0 foo(a: 10, b: 20) #=3D> =A0[10, 20, 30]
> ?


Though the example will not work because x is in the different
variable scope, you can write any expression as a default value,
like:

  def foo(str: File.read("/etc/passwd"))
    p str
  end
  foo(str: "bar") #=3D> "bar"
  foo             #=3D> the contents of /etc/passwd

... currently it does not work correctly because of bug of my
implementation, though :-)
I'll update the patch tomorrow.

--=20
Yusuke Endoh <mame / tsg.ne.jp>