From: "Hal E. Fulton" Date: 2002-12-07T14:03:50+09:00 Subject: Re: elseif? ----- Original Message ----- From: "Paul J. Sanchez" Newsgroups: comp.lang.ruby To: "ruby-talk ML" Sent: Friday, December 06, 2002 4:33 PM Subject: Re: elseif? > I disagree with any proposal to remove "elsif" and replace it with > "elseif" - that would hose way too much work and way too many current > users. I still like the idea of adding "elseif" as an alias, because > it doesn't change the status quo yet makes the language a little more > friendly to native English speakers. I still believe what I said > several months ago: I think it's a human factors issue for native > speakers of English. To me it's as jarring as reading through a > usenet post and seeing repeated use of "there" instead of "their". I > can extract the meaning, and I could write like that too, but it takes > effort to do so and is more prone to error on my part. If Ruby were > the only language I were using, I'd probably soon get used to it. > However, in reality I switch back and forth between Ruby and Java, > C/C++/Objective-C, and lately I've been playing with OCaml - all of > them, along with English, keep the "e" at the end of "els", which > makes Ruby's "elsif" a mild annoyance every time I bump into it. > > I've programmed in well over a dozen languages in the last thirty > years, I can just suck it up and use "elsif" as I've been doing for > several months now. It's not a make or break issue. I also > understand that this is not a democracy, and whatever Matz decides is > the way it's going to be. And that's a good thing, he's done a fine > job. But that needn't keep me from voicing my opinion, and hoping my > plea falls on sympathetic ears. 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'. In grad school I created a toy language that had a 'test' statement. (I'm not advocating this for Ruby, BTW, though I personally wouldn't mind seeing it.) It looked like a switch or case statement, but execution simply jumped to the first non-false expression: test expr1: stmt1 expr2: stmt2 ... exprN: stmtN end So it was clearly a multiway branch like a case in Pascal or switch in C, but it wasn't hacked out of stringing ifs together. Actually that little compiler was sort of the testbed for several little ideas of mine. It had several varieties of loop construct: loop, while, repeat, until, maybe one I've forgotten. It had two varieties of Boolean operators -- one that short-circuited and one that did not. Contrary to the popular wisdom it didn't even have a goto ("Come on, every language HAS one."). Contrariwise, it wasn't OOP, because in 1984 I had never done OOP. And it didn't do exceptions because I had never heard of those. It did have a VM, though... the language (Pandora) was compiled to assembly language (Pangloss) and run on the VM (Panacea). Hal