From: Chad Perrin Date: 2007-03-17T08:05:46+09:00 Subject: Re: Newbie: if / elseif On Sat, Mar 17, 2007 at 07:20:42AM +0900, David A. Black wrote: > Hi -- > > On 3/15/07, Chad Perrin wrote: > >On Thu, Mar 15, 2007 at 02:41:53PM +0900, John Joyce wrote: > >> So it doesn't work like the C variety? > >> > >> if ( condition ) > >> statement // maybe done > >> else if ( condition ) > >> statement // or maybe done > >> else > >> statement // done if the 1st and 2nd are not done > > > >Err . . . I'm pretty sure if, elsif, else works exactly like the C if, > >else if, else. > > Pretty much, except in Ruby there's no need for a rule to resolve > if/else ambiguity, because 'end' always makes it clear. Thanks for adding that. I had forgotten about that, largely because I haven't written a line of C/C++ in about five years. I imagine there are other differences as well, but for the general case I haven't run across any (yet). Still new to Ruby, may just not have encountered further differences yet. -- CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ] "Real ugliness is not harsh-looking syntax, but having to build programs out of the wrong concepts." - Paul Graham