I think we simply have a disambiguity here. Since ‘meth’ does accept
keyword arguments, Ruby assumes that one is passed here.
Maybe it’s more clear if you think about
meth({kwarg:0})
Is this supposed to mean that the positional parameter is supplied and
teh keyword parameter should take the default value, or the other way
around? Maybe the syntax of mixed arguments was not cleanly designed,
but in the way it is used now, Ruby has no choice here but to assume
that the key in the hash is a keyword argument.
Thanks.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.