On Wed, 16 May 2001, Hal E. Fulton wrote:

> To summarize, instead of saying (for instance)
>         if [3, 5, 7, 11, 13, 17, 19, 23, 29].include? x then ...
>
> I'd like to say:
>         if x in [3, 5, 7, 11, 13, 17, 19, 23, 29] then ...
>
> Of course, "in" would result in a call to "include?" just as "for" calls
> "each."
>
> I wonder if there's an English-vs-Japanese word-order effect here? Or
> maybe it's just me.
>
> I copy from-to, not to-from -- making some assembly languages harder
> than others, and making me waste a microsecond of thought every time
> I use strcpy() in C.
>
> In the same way, I ask "is this in that?" rather than "does that contain
> this?"
>
> If I talk to my friend on his cellphone, I ask him "Are you in your car?" I
> don't
> ask "Does your car contain you?" I ask "Are you in Texas?" not "Does Texas
> surround you?"

OK... but your examples don't include the word include.  I mean, the
word include is not in your examples :-)  Would you say: "Is breakfast
in that price?" rather than "Does that price include breakfast?"

Which is to say, not that the keyword idea is good or bad, but just
that one could argue it either way based on the analogy with common
idioms.  I think that the current Ruby idiom makes internal sense
(i.e., if the word "include" is involved, then it should be where it
is), though maybe having it positioned to the right makes the
expression harder to parse, sort of like "xxx unless yyy".
(Personally I've never minded that, for some reason.)


David

-- 
David Alan Black
home: dblack / candle.superlink.net
work: blackdav / shu.edu
Web:  http://pirate.shu.edu/~blackdav