From: Joel VanderWerf Date: 2006-03-20T07:32:15+09:00 Subject: Re: [ ruby-Bugs-3843 ] "not" operator used in expression that is a method parameter can generate syntax error Evan Phoenix wrote: > The same goes for your examples though. Now, I'd agree that at first, > the fact that "and" is different from "&&" is a bit.. strange. But > remember that it seems from the fact that "and" is a parser directive > that creates an actual AND node in the AST. Where as, && is simply a > binary operator, and thus a normal method call. Actually, it is "&" that can be defined as a method. You are free define an "&&" method, but it will not be used as expected: irb(main):002:0> class Foo irb(main):003:1> define_method "&&" do puts "HAHA"; end irb(main):004:1> end => # irb(main):005:0> foo = Foo.new => # irb(main):006:0> foo && 123 => 123 irb(main):007:0> foo.send("&&", 123) HAHA => nil -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407