precedence of single-line rescue and assignment
by Matt Neuburg other posts by this author
May 7 2008 10:40AM messages near this date
Re: hash adding values
|
Re: precedence of single-line rescue and assignment
def boom
raise "boom"
end
y = ""
y = boom rescue "fine"
puts y # "fine"
So far so good; the precedence of "rescue" is higher than that of
assignment. But now:
def boom
raise "boom"
end
y = ""
y += boom rescue "fine"
puts y # ""
How does the precedence work here, and should this behavior be
considered a possible bug? m.
--
matt neuburg, phd = matt@[...].com, http://www.tidbits.com/matt/
Leopard - http://www.takecontrolbooks.com/leopard-customizing.html
AppleScript - http://www.amazon.com/gp/product/0596102119
Read TidBITS! It's free and smart. http://www.tidbits.com
Thread:
Matt Neuburg
Matt Neuburg
Matt Neuburg
Matt Neuburg
Yukihiro Matsumoto
Matt Neuburg
Robert Dober
Jens Wille
Albert Schlef
Jens Wille
|