From: mathew
Date: 2005-08-10T02:36:10+09:00
Subject: Re: Yet Another useless Ruby 2 Idea
gabriele renzi wrote:
> well, the same I wrote in the first message (i.e. a method after a
> method, a constant after a method etc)
Consider the following code:
def bar
puts "ONE"
def foo
puts "TWO"
def bar
puts "THREE"
end
bar
foo
What does it print?
Answer #1:
def bar
puts "ONE"
end
def foo
puts "TWO"
end
def bar
puts "THREE"
end
bar
foo
prints
THREE
TWO
Answer #2:
def bar
puts "ONE"
end
def foo
puts "TWO"
def bar
puts "THREE"
end
end
bar
foo
prints
ONE
TWO
So I don't think it's unambiguous at all.
mathew
--
WE HAVE TACOS