From: Jens Wille Date: 2008-05-08T04:51:17+09:00 Subject: Re: precedence of single-line rescue and assignment Albert Schlef [2008-05-07 21:27]: > matt neuburg wrote: >> [...] since the above can be fixed using parentheses: >> >> y += (boom rescue "fine") > > But if `y += boom rescue "fine"` indeed translates into `y += > (boom rescue "fine")` that still doesn't solve the mystery. no, it evaluates to '(y += boom) rescue "fine"'. the '+=' binds tighter than/takes precedence over 'rescue'. def boom; p 'boom'; raise 'boom'; end =>nil def fine; p 'fine'; 'fine'; end =>nil y = '' =>"" y += boom rescue fine "boom" "fine" =>"fine" y =>"" (y += boom) rescue fine "boom" "fine" =>"fine" y =>"" y += (boom rescue fine) "boom" "fine" =>"fine" y =>"fine" cheers jens -- Jens Wille, Dipl.-Bibl. (FH) prometheus - Das verteilte digitale Bildarchiv f端r Forschung & Lehre Kunsthistorisches Institut der Universit辰t zu K旦ln Albertus-Magnus-Platz, D-50923 K旦ln Tel.: +49 (0)221 470-6668, E-Mail: jens.wille@uni-koeln.de http://www.prometheus-bildarchiv.de/