From: Dave Thomas Date: 2001-03-16T07:39:50+09:00 Subject: [ruby-talk:12701] Re: Keyword arguments? Johann Hibschman writes: > Michael Neumann writes: > > > But consider that keyword arguments can be emulated up to a certain degree by > > hashes and special introduced syntax: > > > def method_with_keywords ( hash ); p hash end > > > method_with_keywords :key1 => "value", :key2 => 6565 #==> {:key2=>6565, :key1=>"value"} > > Why does that work? I must have missed that in the specs. That's > crazy magic. But it's pretty usable as it is. It doesn't provide as > much typo checking as, say, Python keywords do, but it's still nice. I don't know about specs, be it's documented in our Language Reference chapter at http://www.rubycentral.com/book/language.html Search for "Invoking a Method". Regards Dave