From: Yukihiro M. [mailto:[email protected]]
end
ora = foo( (baz = 5), (bar = 2) )
??
Second one.
Dan
From: Yukihiro M. [mailto:[email protected]]
end
ora = foo( (baz = 5), (bar = 2) )
??
Second one.
Dan
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
[email protected] 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
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs