`a |= b` is syntactical sugar for `a = a | b`. If you replace :"|=" with :| 
you'll be fine. There's nothing an object can do to fully replicate the 
functionality of |=, though — an object has neither the knowledge nor the 
abilities needed to rebind a variable above its scope.

This holds true for all similar operators; +=, -=, /=, *=, **=,  |= and &=. ||= 
and &&= aren't, though, as these are logical operators that Ruby must treat 
specially.

Now stop frowning; make that |= a :>!

On Jan 3, 2011, at 5:35, Zachary Kaplan wrote:

> while i was doing some programming earlier today i noticed that passing the 
> |= operator to the send method of an array results in an NoMethodError
> 
> here is simple gist of an irb session demonstrating the bug: 
> https://gist.github.com/763108
> 
> also - i noticed this which is unrelated but may also be a bug: 
> https://gist.github.com/763118
> 
> -zak
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel@lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

_______________________________________________
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

Reply via email to