From: Charles Comstock Date: 2004-02-26T08:39:47+09:00 Subject: Re: [ot] proposal: debug keyword Simon Strandgaard wrote: > On Wed, 25 Feb 2004 15:38:53 +0100, Robert Klemme wrote: > >>"Simon Strandgaard" schrieb im Newsbeitrag >> >>>Any ideas for a good name? >>> >>>debug replacement puts -> #debug_puts, #dputs >>>debug replacement p -> #debug_p, #dp >> >>Hm... I'd go for "d_puts" which is immediately distinguished from "puts" >>but is not so much typing overhead as the more verbose "debug_puts". >> >> >>>maybe just turn the 'p' in 'puts' upsidedown, so it becomes a 'd' => >> >>duts? >> >>http://www.best-lyrics-zone.net/Upside_Down_Lyrics.html >>:-) >> > > > BTW: I had to change my taste of music so it reflect the language I am using > > diamonds are forever > lucy in the sky with diamonds > diamonds are a girls best friend > > -- > Simon Strandgaard It would be nice if we had macros for the debug stuff, so the code would never even be seen when you didn't do debug code. For instance if instead for debug output you had a debug block, which was evaled and added to the code on the first pass, so it would execute all further passes. This would only occur if $debug was set, otherwise the code would never be evaled, and we wouldn't even test to see if the verbose flag was set, and thus it would never actually get executed. I suppose this could also be simulated if we had constant propagation in the interpreter, so that a constant if expression would be eliminated. Another comment though, I really hate having only the ability to turn debug output off globally. It's much nicer to be able to turn it all on or off, but also be able to turn it on per the scope you are in. Charlie