Ruby-dev summary 23566-23622

Nobu [mailto:nobu.nokada@softhome.net]:

Paul Brannan wrote in [ruby-talk:102177]:

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?)

The former. The latter syntax will be

foo(foo: 14, bar: 92)

Where will the ** notation fit in? Will it be:

  foo(** :foo => 14, :bar => 92)
  foo(**{ :foo => 14, :bar => 92 })

And this will effectively make one of those two:

foo(foo: 14, bar: 92)

?

-austin

···

--
austin ziegler * austin.ziegler@evault.com

Hi,

At Fri, 4 Jun 2004 00:06:07 +0900,
Austin Ziegler wrote in [ruby-talk:102289]:

Where will the ** notation fit in? Will it be:

  foo(** :foo => 14, :bar => 92)
  foo(**{ :foo => 14, :bar => 92 })

As well as *array, it prefixes an expression. So the former
wouldn't be valid syntax.

And this will effectively make one of those two:

> foo(foo: 14, bar: 92)

?

AFAIK, it will.

···

--
Nobu Nakada