# Re: Confusion Over Keyword Arguments

**URL:** <https://www.ruby-forum.com/t/re-confusion-over-keyword-arguments/75757>\
**Category:** Ruby\
**Created:** [March 2, 2006, 5:09pm UTC](https://www.ruby-forum.com/t/re-confusion-over-keyword-arguments/75757 "2006-03-02T17:09:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BergerS\_Daniel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc8723/32.png) [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Post date:** [March 2, 2006, 5:09pm UTC](https://www.ruby-forum.com/t/re-confusion-over-keyword-arguments/75757/1 "2006-03-02T17:09:23Z")

</div>

> > > From: Yukihiro M. [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]
> > 
> > end  
> > or
> 
> a = foo( (baz = 5), (bar = 2) )
> 
> ??

Second one.

Dan

---

<div class="post-metadata">

**Author:** ![BergerS\_Daniel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc8723/32.png) [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Post date:** [March 2, 2006, 5:17pm UTC](https://www.ruby-forum.com/t/re-confusion-over-keyword-arguments/75757/2 "2006-03-02T17:17:59Z")

</div>

On Fri, 3 Mar 2006, Berger, Daniel wrote:

> > foo baz = 5, bar = 2
> > 
> > a, b = foo(baz = 5), (bar = 2)
> > 
> > or
> > 
> > a = foo( (baz = 5), (bar = 2) )
> > 
> > ??
> 
> Second one.

but that’s a problem no? number two is the same as this

baz = 5  
bar = 2  
a = foo baz, bar

see, when on writes

foo baz = 5, bar = 2

it’s ambiguous if those assignments are part of a method call or not.  
bar  
escpecitally, it could easily be considered an assignment statement  
(bar=2)  
that’s part of a parrallel assignment statement.

or am i missing something?

-a

---

<div class="post-metadata">

**Author:** ![BergerS\_Daniel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc8723/32.png) [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Post date:** [March 2, 2006, 5:23pm UTC](https://www.ruby-forum.com/t/re-confusion-over-keyword-arguments/75757/3 "2006-03-02T17:23:06Z")

</div>

removed\_email\_address@domain.invalid wrote:

> > > ??
> > 
> > Second one.
> 
> but that’s a problem no? number two is the same as this
> 
> baz = 5  
> bar = 2  
> a = foo baz, bar

No, then they become positional. That’s the same as foo 2, 5.

> see, when on writes
> 
> foo baz = 5, bar = 2
> 
> it’s ambiguous if those assignments are part of a method call or not. bar  
> escpecitally, it could easily be considered an assignment statement (bar=2)  
> that’s part of a parrallel assignment statement.
> 
> or am i missing something?

The parser just has to be trained well enough. 🙂

That being said, perhaps using ‘=’ as a keyword operator would just  
cause too  
much confusion amongst the Ruby community. I know some people hate  
changing  
behavior based on context.

Regards,

Dan
