From: mental@... Date: 2006-03-02T07:17:06+09:00 Subject: Re: Confusion Over Keyword Arguments Quoting Jeff Cohen : > unknown wrote: > > Quoting Jeff Cohen : > > > > Assignments are legal in most places that => is; would you want > > to trade one for the other? > > > > -mental > > Really? This works for me: > > h = { 'a' => 5, 'b' => 6 } > > but this gives my syntax errors: > > h = { 'a' = 5, 'b' = 6 } Legal, not equivalent. For example, you can do this: p { 'a' => k = 5, 'b' => 6 } p k which would print: {"a"=>5, "b"=>6} 5 The arguments to => can be any legal Ruby expressions, including assignments. -mental