On 3/7/07, 7stud 7stud <dolgun / excite.com> wrote:
> What the??  I just spent two days trying to figure out why I couldn't
> reproduce the example in "Ruby in 20 minutes" and get it to work.  After
> examining my code line for line against the example code and not being
> able to detect any error, I was assembling several code examples into a
> text file to post here, when I happened to notice  'elsif'.    Why
> didn't Ruby flag 'elseif' as an error?
Because it nvere sees it :(

Look at two examples

if true then
   whatever
   elseif
end

now elsif is seen as an undefined method but

if false then
  whatever
  elseif
end

whatever and elseif are not evaluated.

I strongly advice you to use a syntax highlighting ediotr like e.g.
vim, emacs, Jedit, geany and tons of others.

Cheers
Robert
>
>
> Does Ruby try differentiate itself in ridiculous ways like that just for
> the sake of being different?  And why isn't something like that
> explicitly pointed out in a beginning tutorial?  So far, I have to give
> Ruby two thumbs down.
>
> C++, Java,  Javascript, php, Servlets+JSP programmer
>
> --
> Posted via http://www.ruby-forum.com/.
>
>


-- 
We have not succeeded in answering all of our questions.
In fact, in some ways, we are more confused than ever.
But we feel we are confused on a higher level and about more important things.
-Anonymous