From: John Woods Date: 2007-10-12T14:39:03+09:00 Subject: Syntax error when redefining >> operator to take a block I'm trying to redefine the >> operator for a particular class such that it takes a block as its argument. It works if I invoke the redifined >> operator using "." syntax, but causes a syntax error otherwise. This code illustrates my problem: class C def >>(&block) block.call("inside >>") end end c = C.new c.>> { |x| puts x } # outputs "inside >>" #c >> { |x| puts x } # syntax error, if uncommented This is the syntax error reported: test.rb:10: syntax error, unexpected '|', expecting '}' c >> { |x| puts x } # syntax error, if uncommented ^ test.rb:10: syntax error, unexpected tIDENTIFIER, expecting kDO or '{' or '(' c >> { |x| puts x } # syntax error, if uncommented ^ Any pointers? Thanks.