From: Joshua Ballanco Date: 2011-10-19T00:52:19+09:00 Subject: [ruby-core:40212] Re: [Ruby 2.0 - Feature #5454] keyword arguments --e89a8f64782342681104af94b5be Content-Type: text/plain; charset=UTF-8 On Tue, Oct 18, 2011 at 11:31 AM, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: [ruby-core:40207] Re: [Ruby 2.0 - Feature #5454] keyword > arguments" > on Wed, 19 Oct 2011 00:14:13 +0900, Joshua Ballanco < > jballanc@gmail.com> writes: > > |With the current proposal for keyword arguments, I think MacRuby would not > |be able to implement this feature. > > I know. But I have warned MacRuby guys for years. > Heh, indeed. I just spoke briefly with lrz, and he's optimistic that we can make it work. One question I have, though, would be if you intend to allow variables as default values or only literals. For example, should this work: x = 30 def foo(a: 1, b: 2, c: x) puts [a, b, c] end foo(a: 10, b: 20) #=> [10, 20, 30] ? --e89a8f64782342681104af94b5be Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Tue, Oct 18, 2011 at 11:31 AM, Yukihiro Matsu= moto <matz@ruby-= lang.org> wrote:
Hi,

In message "Re: [ruby-core:40207] Re: [Ruby 2.0 - Feature #5454] keywo= rd arguments"
=C2=A0 =C2=A0on Wed, 19 Oct 2011 00:14:13 +0900, Joshua = Ballanco <jballanc@gmail.com&g= t; writes:

|With the current proposal for keyword arguments, I think MacRuby would not=
|be able to implement this feature.

I know. =C2=A0But I have warned MacRuby guys for years.

Heh, indeed. I just spoke briefly with lrz, and he&#= 39;s optimistic that we can make it work. One question I have, though, woul= d be if you intend to allow variables as default values or only literals. F= or example, should this work:

=C2=A0 =C2=A0 x =3D 30
=C2=A0 =C2=A0 def foo(= a: 1, b: 2, c: x)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 puts [a, b, c]
=C2=A0 =C2=A0 end
=C2=A0 =C2=A0 foo(a: 10, b: 20) #=3D> = =C2=A0[10, 20, 30]

?

--e89a8f64782342681104af94b5be--