From: "rpardee@..." Date: 2006-10-15T02:30:15+09:00 Subject: Re: What is the reason for this syntax? I confess I haven't really followed this thread carefully, but--I totally agree on the 'elsif' keyword. Wouldn't it be possible for ruby to accept *either* spelling? If so, I would definitely advocate it--you don't lose anything for the perlsters, and those of us coming from other languages won't have to deal w/the IMHO surprising spelling. I remember dealing w/this same issue while learning pl/sql. After staring at my modest program for like 40 minutes looking for the complained-of syntax error, I was bitter bitter bitter when I finally learned that I was expected to mis-spell 'else'... I actually thought ruby did this already--had to write a little script to verify that it doesn't... Cheers, -Roy Kevin Olemoh wrote: > Hello I have been using ruby off and on for a few months and I have been > having a great time with the language but a few things bother me about > the syntax of the language itself. The two glaring issues are: > > 1. The syntax errors generated by the following code: > > a.each > do > #stuff > end > > for reasons I do not understand ruby demands that, that line be written as: > a.each do > #stuff > end > > Quite frankly I find the second form to be more difficult to read > especially if one tends to create blocks with braces rather than the do > end keywords like I do. Is there some specific reason that both forms > are not supported by Ruby? It is needlessly restrictive with respect to > formatting in my opinion, perhaps a kind ruby-core developer could sneak > this syntax change into a future release? > > 2. What is with the elseif syntax specifically why is it elsif instead > of elseif when ruby already has an else keyword? I can't count how many > times I got errors because I decided to type elseif instead of elsif > while doing something with an if statement. I can name at least two > popular languages that use elseif not to mention the fact that if > English is your first language you will probably spell out else without > even realizing it since that is the correct way to spell the word in > English. Yes I know its a minor thing but if no one voices their > gripes how do people know something might need a bit of tweaking? :)