See below.

----- Original Message ----- 
From: Andrew D. McDowell <drew / localhost.localdomain.web-hosting.com>
To: ruby-talk ML <ruby-talk / netlab.co.jp>
Sent: Wednesday, November 29, 2000 10:10 PM
Subject: [ruby-talk:6666] Suggestion for addition to Begin/End syntax


> Hi all.
> I'm very new to Ruby so this might be a bit of a shot in the dark, 
> but I'd like to suggest a minor change in the block 'end' syntax
> that may help readability.
> It's not a new idea, but it's something that I found helpfull
> when reading Dylan code:
> 
> When the 'end' statement is used to close a code block, allow an
> optional word or two of description.
> They can be ignored by the interpreter, but it'd be usefull for 
> debugging for them to be matched. 
> 
> Basicaly, any of the following would be acceptable:
> 
> def foo()
>   print "Foo!\n"
> end 
> 
>  -or-
> 
> def foo()
>   print "Foo!\n"
> end def 
> 
>  -or-
> 
> def foo()
>   print "Foo!\n"
> end foo 
> 
>  -or-
> 
> def foo()
>   print "Foo!\n"
> end def foo
> 

I like the idea, Drew, and I brought up something like it myself once.

BUT... my understanding is that this feature used to be in Ruby (long
ago?) and was removed... the reason being the existence of 
modifiers such as until, if, etc.

begin
  # ...
end until x > 0

So comments might be the best way to achieve this. I don't like that
approach, though, and have decided to rely on indentation. This also
motivates me to keep blocks short (as they should be).

Hal Fulton