[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: include? needs parentheses?
From:       "Robert Klemme" <bob.news () gmx ! net>
Date:       2004-04-14 9:39:23
Message-ID: c5j0ji$24o5e$1 () ID-52924 ! news ! uni-berlin ! de
[Download RAW message or body]


"Gavin Sinclair" <gsinclair@soyabean.com.au> schrieb im Newsbeitrag
news:50505.129.78.228.114.1081916392.squirrel@webmail.imagineis.com...
> I find this kind of odd.
>
>   $ ruby -w
>   puts([1,2,3].include? 1)
>   -:1: warning: parenthesize argument(s) for future version
>   true
>
> Surely there's no ambiguity in that expression.  What principle is at
work
> here?
>
> Sorry if this is similar to other cases already discussed.  I was paying
> attention, but those cases seemed more ambiguous, hence the warning.

I can only guess: maybe it's because the line "puts([1,2,3].include? 1,2)"
would be amiguous?

    robert


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic