On Thu, Jun 03, 2004 at 12:00:51AM +0900, Takaaki Tateishi wrote:
> [ruby-dev:23572] keyword argments (Ruby2.0 spec)
> 
>   Nagai asked how keyword arguments and hash-style arguments work in
>   ruby-2.0, since a lot of hash-style arguments appear in his extension
>   library 'Ruby/Tk'. Matz proposed following two solutions.
>     (a) hash-style argument appearing at the end of argument list is
>         supported as usual.
>     (b) hash-style arguments were abolished.

I'd prefer (a), because backward-compatibility is a good thing, and I'd
prefer to change my code as little as possible to make it work on Ruby
2.0.

But how would (a) work?  It seems like it would make the following
ambiguous:

def foo(foo, bar=2)
end

foo(:foo => 14, :bar => 92)

(is this calling foo with a hash and leaving bar with default argument,
or is it calling foo with foo equal to 14 and bar equal to 92?)

If (b) is chosen, it would be nice if hash-style arguments were
deprecated for a version between current and 2.0.

>   Nagai chose a case for (b) because of rapid shift to ruby-2.0.

I don't understand.  What is meant by "rapid shift to ruby-2.0"?

Paul