From: Gavin Sinclair Date: 2002-12-08T14:04:26+09:00 Subject: Re: elseif? From: "Joel VanderWerf" > Martin DeMello wrote: > > Joel VanderWerf wrote: > > > >>x = 1.5 > >> > >>case true > >> when x < 0; puts "x < 0" > >> when 0 <= x && x < 1; puts "x in interval [0,1)" > >> when 1 <= x && x < 2; puts "x in interval [1,2)" > >> when 2 <= x; puts "x >= 2" > >>end > >> > >>Sorta like cond in lisp... > > > > > > Nice!! You should add it to the RubyIdioms wiki page. > > But I've never actually used it. :) I added it, and included a nasty swipe at Hal :) Gavin