From: Daniel Schierbeck Date: 2005-10-12T21:09:09+09:00 Subject: Re: Keyword arguments in Rite ES wrote: > Daniel Schierbeck wrote: > >> Hello everybody! I'm new to this list, so please don't flame me if >> what I'm saying is absolute nonsense. >> >> I was looking at the RubyGarden page about Rite >> (http://rubygarden.org/ruby?Rite), and I starting playing around with >> the keyword argument syntax. Basically, I think it's rather >> confusing. Take this for example: >> >> a: :b >> >> This would be the same as :a => :b. Maybe it's just me, but it >> doesn't really shine through that you're assigning the value :b to >> the keyword :a. I think this is much clearer >> >> :a = :b >> >> def foo (:bar = "bar", :baz = 123); end >> >> some_method(:a = 1, :b = 2, :c = 3) >> >> It has the same syntax as variable setting, which I think is >> appropriate. > > > It looks better when you do something like this: > > document = make_document from: 'foo.txt', using: LaTeX > > ;) > >> >> Yours sincerely, >> Daniel Schierbeck > > > E Just one more question. I know you'll be able to write def foo(a: 1, b: 2, c: 3) But will you also be able to write it as def foo(:a => 1, :b => 2, :c => 3) 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. Cheers, Daniel Schierbeck