From: George Ogata Date: 2005-02-13T03:15:00+09:00 Subject: Re: utilizing ++ and -- for comments Brian Mitchell writes: > On Sat, 12 Feb 2005 11:47:03 +0900, "Pe�a, Botp" wrote: >> Since ++ and -- wont see the light of day in ruby, can we use it for comment >> notation? >> >> define: >> 1. -- equal to # comment >> 2. --- (or more dashes) equal to =begin >> next --- (or more) equal to =end >> 3. ++ same comment as #1 above >> 4. +++ same comment as #2 above >> > > I would like to see a multi-line that can nest other multi-line > comments. useful for quick and dirty code changes. > > --- Disable this entire section > --- My other section that holds > important documentation. > --- > code ... ... > --- Here's yer multiline comment: g@crash:~/tmp$ cat test.rb puts 1 %{ puts 2 %{ puts 3 } puts 4 } puts 5 g@crash:~/tmp$ ruby test.rb 1 5 > so this is a problem. Lua has some interesting comments. They are ugly > but they have some nice uses. see http://www.lua.org/pil/1.3.html > (bottom half). Any ideas how we could clean it up a bit? I like the > single hyphen toggle. And here's yer "single-hyphen" toggle: g@crash:~/tmp$ cat test.rb def q; yield end puts 1 %q{ puts 2 %q{ puts 3 } puts 4 } puts 5 g@crash:~/tmp$ ruby test.rb 1 5 g@crash:~/tmp$ cat test.rb def q; yield end puts 1 q{ puts 2 %q{ puts 3 } puts 4 } puts 5 g@crash:~/tmp$ ruby test.rb 1 2 4 5