From: Michael Neumann Date: 2001-07-05T23:12:34+09:00 Subject: [ruby-talk:17302] Re: /* */ comments David Alan Black wrote: > Hello -- > > On Thu, 5 Jul 2001, Michael Neumann wrote: > > > Has someone told, that we have already something like > > multiline comments? > > > > Just make the piece of code you want to comment out > > a string with %{ .... }. It's also possible to nest them. > > > > For example Python users often use this (with """ thus not nestable), > > especially for documenting classes/methods. > > > > The only problem I can see is that if it occurs at the end of a method/block > > it's taken as return value. > > > The other problem is that then you have strings lying around out of > context: > > def thing > end > > %{ > def other_thing > end > } > > => > comments.rb:6: warning: useless use of a literal in void context > Syntax OK Thanks, I forgot that issue. But we now have %{ and %r{ , so why not add a third case for example %c{ which behave in the same way except that it do not throws a warning and that it do not alter the return value of a method/block? I think that way, we don't have to make so many changes to the Ruby interpreter. Regards, Michael -- Michael Neumann merlin.zwo InfoDesign GmbH http://www.merlin-zwo.de