From: Daniel Schierbeck Date: 2005-10-17T02:21:49+09:00 Subject: Re: Keyword arguments in Rite Stefan Kaes wrote: > Yukihiro Matsumoto wrote: > >> Hi, >> >> In message "Re: Keyword arguments in Rite" >> on Wed, 12 Oct 2005 21:09:09 +0900, Daniel Schierbeck >> writes: >> >> |Just one more question. I know you'll be able to write >> | >> | def foo(a: 1, b: 2, c: 3) >> >> Yes. >> >> |But will you also be able to write it as >> | >> | def foo(:a => 1, :b => 2, :c => 3) >> >> Perhaps, or you will get a hash as a last argument. >> >> |Or maybe even (as I wrote before) >> | >> | def foo(:a = 1, :b = 2, :c = 3) >> | >> |I can see that the key: value thing is cool, but :key = value would >> also |be nice. It is also clearer in method definitions. >> >> I just don't know how nice and clean it is. It just seems to be >> assignment to a symbol for me. >> >> matz. >> >> >> >> > I'm not quite up to date in this discussion, but, if > > def foo(a = 1, b = 2) > > is the syntax for positional parameters with default values, I would > expect > > def foo(:a = 1, :b = 2) > > to be the syntax for keyword arguments with default values. > > But that's just my personal expectation ;-) > > -- stefan kaes > > Exactly :) PS. I know I forgot the **keys def foo(:a = 1, :b = 2, **keys) Cheers, Daniel