From: Clifford Heath Date: 2010-11-12T10:55:15+09:00 Subject: Re: Scheme's (cond ((assertion) (value))...(else (value))) statement implemented in ruby? timr wrote: > Hi Rubyists, > I love ruby, but am learning scheme and kinda like the (cond > ((assertion) (value))...(else (value))) syntax for what would normally > look like this in ruby: > > if (assertion 1) > value 1 > elsif (assertion 2) > value 2 > else > default > end > > I find scheme's cond syntax more quickly digestible since it reads > like a table. > (cond > ((assertion 1) (value 1)) > ((assertion 2) (value 2)) > (else (default))) What's wrong with this? x = 3 case when x == 2; puts 'two' when x == 3; puts 'three' else puts 'other' end Clifford Heath.