From: Ryan Davis Date: 2012-02-21T14:46:55+09:00 Subject: Re: 1.9.2 syntax issues On Feb 19, 2012, at 13:49 , Hal Fulton wrote: > I admit I still use 1.8.x more often than 1.9.x -- and I keep running across > little things that puzzle or annoy me. > > Why is it that this statement: > > value = > if block_given? > yield str > else > str.send(converter) > end > > cannot be rewritten as: > > value = block_given? ? yield str : str.send(converter) Doesn't look like a 1.8 vs 1.9 issue: % ruby -vwe 'def x str; value = block_given? ? yield str : str.send(converter); end' ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0] -e:1: syntax error, unexpected tIDENTIFIER def x str; value = block_given? ? yield str : str.send(converter); end ^ All versions of ruby that I test against want `yield(str)`.