Hi --

On Fri, 11 Apr 2008, Robert Dober wrote:

> On Fri, Apr 11, 2008 at 2:39 PM, David A. Black <dblack / rubypal.com> wrote:
>> Hi --
>>
>>
>>
>>  On Fri, 11 Apr 2008, Robert Dober wrote:
>>
>>
>>>
>>>>  [false,nil][rand(2)].send([:&&,:||][rand(2)],
>>>>  method_returning_a_completeley_random_object)
>>>>
>>> oops, whats going wrong in my brain I was 100% sure that && was a
>>> method, but :&& is not even a symbol, what is the reason for that?
>>> I am obviously missing the obvious....
>>>
>>
>>  I'm not sure what the exact rule is, but for operators I think you
>>  always have to quote them to get their symbol:
>>
>>   :"&&"
> No David
> irb(main):017:0* x=:&

& isn't an operator, though; it's a method. I don't know whether
that's actually why there's the difference with regard to symbol-izing
them, but I think it does at least mostly fall along those lines.


David

-- 
Rails training from David A. Black and Ruby Power and Light:
   ADVANCING WITH RAILS   April 14-17          New York City
   INTRO TO RAILS         June 9-12            Berlin
   ADVANCING WITH RAILS   June 16-19           Berlin
See http://www.rubypal.com for details and updates!