Forum: Ruby Re: Confusion Over Keyword Arguments

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F3b7b8756d0c7f71cc7460cc33aefaee?d=identicon&s=25 Berger, Daniel (Guest)
on 2006-03-02 23:02
(Received via mailing list)
> >>
> > to
> > Here's the latest test case we had for Sydney.  Note that Sydney
> http://redhanded.hobix.com/inspect/namedParameters...
> > # You can use named parameters, using the name of the parameter
> Your testcases do not seem to cover the scope completely and
>    assert_nothing_raised{ @foo.bar(z:1, x:2, y:3) }
>   end                                      # test_corner_cases
>
> To cover those.

Yes, I think this is one of the reasons we started leaning towards using
'=' instead.  Maybe we should stick with '=>' - no issues with symbols
or assignment, and people are used to it.

Regards,

Dan
D111305c32e46f7dd2794a956208d347?d=identicon&s=25 E. Saynatkari (Guest)
on 2006-03-02 23:35
Berger, Daniel wrote:
>> >>
>> > to
>> > Here's the latest test case we had for Sydney.  Note that Sydney
>> http://redhanded.hobix.com/inspect/namedParameters...
>> > # You can use named parameters, using the name of the parameter
>> Your testcases do not seem to cover the scope completely and
>>    assert_nothing_raised{ @foo.bar(z:1, x:2, y:3) }
>>   end                                      # test_corner_cases
>>
>> To cover those.
>
> Yes, I think this is one of the reasons we started leaning towards using
> '=' instead.  Maybe we should stick with '=>' - no issues with symbols
> or assignment, and people are used to it.

Both problems should be fixed by mandating that there
be a space between foo: and its argument :) What other
parsing issues that might bring is different.

> Regards,
>
> Dan


E
This topic is locked and can not be replied to.