S Wayne
7/29/2006 6:18:00 AM
Yes, it has been considered. Unfortunately allowing the
interpreter/compiler figure this out only works in the extremely
simple case
Consider:
a=[1,2,3]
for i in a
begin
if i > 1
x = 3*i
end
end
puts x
Obviously there is a missing end statement. However, where we put it
makes a big difference. If we put it before the puts x, we get a very
different output then if we put it after puts x. This is a simple
example as well, even more complex examples will show that it gets
very dangerous to let the interpreter figure out what you meant.
Using indentation is dangerous, because indentation doesn't mean
anything in ruby normally, and trying to figure out the right thing
would mean that we start having to be careful with indentation levels,
and code works in strange ways because we don't know ruby is 'helping'
us out. It can make for very hard to find bugs.