From: "Hal E. Fulton" Date: 2002-12-08T08:24:51+09:00 Subject: Re: elseif? ----- Original Message ----- From: "Joel VanderWerf" To: "ruby-talk ML" Sent: Saturday, December 07, 2002 3:18 PM Subject: Re: elseif? > Hal E. Fulton wrote: > ... > > Well, I too prefer "elseif" to "elsif" -- but I don't see > > that it will be added, and it's a very minor point. > > > > Actually, what I've always wished for is a multiway Boolean > > branch that was *obviously* such, not merely a special case > > of 'if'. > > How 'bout this: > > 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 In essence, that's what I'm talking about. But the way it's expressed here makes it seem even more foreign than cascading if/elsifs. I've just always wished a language provided direct support for such a construct. But I've never run across anyone else who wished for it. > > Sorta like cond in lisp... Probably. I don't know LISP. Still thinking of learning it someday -- along with FORTH, Latin, and Esperanto... Hal