From: Michael Neumann Date: 2001-11-03T08:54:48+09:00 Subject: [ruby-talk:24238] Re: inline comments, IDs Tobias Reif wrote: > Michael Neumann wrote: > > > > Do you think of a comment inside one line of code? > > > yep > > This is not really > > possible. But you could do it as follows: > > > > before: > > 3 + 4 + 5 + 5 - 4 - 5 > > > > after: > > 3 + 4 + (%{5 + 5 - 4}; - 5) > > > OK > > > > Better is to copy the line and comment the duplicate out. > > > Why? It looks nicer and do not confuse the reader (I think my example above would). > Just thought of that; a simple counter + ~ > format("%09.0f", counter) yes, or counter = "0000000000" # any string counter.succ! would do it, too (but probably slower ;-). Regards, Michael -- Michael Neumann merlin.zwo InfoDesign GmbH http://www.merlin-zwo.de