Re: multi-line comments, C macros, Pod abuse

2006-08-21 Thread Joshua Hoblitt
On Mon, Aug 21, 2006 at 12:06:36AM +0100, Andrew Suffield wrote: On Sun, Aug 20, 2006 at 03:55:56PM -0600, Luke Palmer wrote: Why would you care about introducing a new lexical scope? You would care about that if you used a variable you declared in the commented code in the code below

Re: multi-line comments, C macros, Pod abuse

2006-08-21 Thread markjreed
I think this is not even a metaprogramming issue so much as a programming environment one. I mean, if your editor doesn't make it easy to stick a # at the beginning of a bunch of lines with one action, and likewise remove them later, you need to get a new editor. :) On 8/21/06, Joshua Hoblitt

Re: multi-line comments, C macros, Pod abuse

2006-08-20 Thread Joshua Hoblitt
On Sat, Aug 19, 2006 at 02:26:28AM +, Luke Palmer wrote: On 8/19/06, Aaron Crane [EMAIL PROTECTED] wrote: You don't actually need a macro in that case: if 0 { q ... } Which, of course, eliminates the original desire to have a code-commenting construct where you just

Re: multi-line comments, C macros, Pod abuse

2006-08-20 Thread Mark J. Reed
On 8/20/06, Joshua Hoblitt [EMAIL PROTECTED] wrote: This is exactly the type of construct that I had in mind. A couple of questions. Is code inside of a #{}: - parsed and required to be syntacticly correct? No. It's a comment. # followed by one or more open bracket characters creates a

Re: multi-line comments, C macros, Pod abuse

2006-08-20 Thread Andrew Suffield
On Sun, Aug 20, 2006 at 10:50:31AM -1000, Joshua Hoblitt wrote: #{ if $baz { $foo.bar } } To uncomment, remove the # before the {. This is exactly the type of construct that I had in mind. A couple of questions. Is code inside of a #{}: - parsed and required

Re: multi-line comments, C macros, Pod abuse

2006-08-20 Thread Larry Wall
On Sun, Aug 20, 2006 at 10:50:31AM -1000, Joshua Hoblitt wrote: : On Sat, Aug 19, 2006 at 02:26:28AM +, Luke Palmer wrote: : On 8/19/06, Aaron Crane [EMAIL PROTECTED] wrote: : You don't actually need a macro in that case: : : if 0 { q : ... : } : : Which, of course,

Re: multi-line comments, C macros, Pod abuse

2006-08-20 Thread Luke Palmer
On 8/20/06, Andrew Suffield [EMAIL PROTECTED] wrote: On Sun, Aug 20, 2006 at 10:50:31AM -1000, Joshua Hoblitt wrote: #{ if $baz { $foo.bar } } To uncomment, remove the # before the {. This is exactly the type of construct that I had in mind. A couple of questions.

Re: multi-line comments, C macros, Pod abuse

2006-08-20 Thread Luke Palmer
On 8/20/06, Luke Palmer [EMAIL PROTECTED] wrote: Well, I think you are being too picky. [snip snarky sarcastic rant] Hmm, perhaps I'm feeling edgy. Or maybe some of the comments reminded me of those rediculously long, whiny threads. Anyway, that was un-called-for. Luke

Re: multi-line comments, C macros, Pod abuse

2006-08-20 Thread Andrew Suffield
On Sun, Aug 20, 2006 at 03:55:56PM -0600, Luke Palmer wrote: The important question here is this one: - when 'uncommented', is it a no-op? Which isn't true for #{}/{}, because {} introduces new lexical scope. Why would you care about introducing a new lexical scope? You would care

Re: multi-line comments, C macros, Pod abuse

2006-08-19 Thread Nicholas Clark
On Sat, Aug 19, 2006 at 02:26:28AM +, Luke Palmer wrote: On 8/19/06, Aaron Crane [EMAIL PROTECTED] wrote: You don't actually need a macro in that case: if 0 { q ... } Which, of course, eliminates the original desire to have a code-commenting construct where you just

Re: multi-line comments, C macros, Pod abuse

2006-08-19 Thread Dr.Ruud
Stuart Cook schreef: Larry Wall: if 0 { ... } The one disadvantage of that approach is that it will break if the commented-out code temporarily fails to compile. How frequent does that happen? And in that case s/if 0/\#/, as Luke mentioned. And if the compile failure has to

Re: multi-line comments, C macros, Pod abuse

2006-08-19 Thread Daniel Hulme
Stuart Cook schreef: Larry Wall: if 0 { ... } The one disadvantage of that approach is that it will break if the commented-out code temporarily fails to compile. How frequent does that happen? All the time. I often comment out bits of code while I'm refactoring or

multi-line comments, C macros, Pod abuse

2006-08-18 Thread Joshua Hoblitt
It occurred to me that other day that in our in house C code we somewhat frequently use an idiom that's not easily translated into Perl 5. Our rule is that if your commenting out more then 1 or 2 lines of code that you wrap it in a CPP if statement. The logic being that if you haven't deleted

Re: multi-line comments, C macros, Pod abuse

2006-08-18 Thread Larry Wall
On Fri, Aug 18, 2006 at 11:58:20AM -1000, Joshua Hoblitt wrote: : It occurred to me that other day that in our in house C code we : somewhat frequently use an idiom that's not easily translated into Perl : 5. Our rule is that if your commenting out more then 1 or 2 lines of : code that you wrap

Re: multi-line comments, C macros, Pod abuse

2006-08-18 Thread Stuart Cook
On 8/19/06, Larry Wall [EMAIL PROTECTED] wrote: if 0 { ... } The one disadvantage of that approach is that it will break if the commented-out code temporarily fails to compile. If that's a problem, though, you could always write your own macro. Stuart Cook

Re: multi-line comments, C macros, Pod abuse

2006-08-18 Thread Aaron Crane
Stuart Cook writes: On 8/19/06, Larry Wall [EMAIL PROTECTED] wrote: if 0 { ... } The one disadvantage of that approach is that it will break if the commented-out code temporarily fails to compile. If that's a problem, though, you could always write your own macro. You don't

Re: multi-line comments, C macros, Pod abuse

2006-08-18 Thread Luke Palmer
On 8/19/06, Aaron Crane [EMAIL PROTECTED] wrote: You don't actually need a macro in that case: if 0 { q ... } Which, of course, eliminates the original desire to have a code-commenting construct where you just change the 0 to a 1. After all, we already have #{}.