From: 7stud 7stud Date: 2007-03-07T20:28:43+09:00 Subject: Re: elseif v. elsif ?? 7stud 7stud wrote: > 7stud 7stud wrote: >>>That's because you're not exercising the section under @names.nil? >>>Try: mg = MegaGreeter.new(nil) >> >>>You spoiled it ;) >>>but this is a good way to explain it too... >> >> What does that have to do with anything? >> > > I tried it, and I got an error for the 'elseif'. Why is that? If the > first branch succeeds, why is the elsif branch even evaluated? Hmm...I think I get it: Ruby doesn't realize elseif is another branch, it just thinks its the next statement after the if statement. But as far as I know, all if statements are terminated with 'end'. -- Posted via http://www.ruby-forum.com/.