On Sun, Aug 20, 2006 at 10:50:31AM -1000, Joshua Hoblitt wrote:
: On Sat, Aug 19, 2006 at 02:26:28AM +0000, 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 change the 0 to a 1".  After
: > all, we already have #{}.  Incidentally, you could consider that the
: > desired construct, because it balances, and a closure at statement
: > level executes itself:
: > 
: > #{
: >    if $baz {
: >        $foo.bar
: >    }
: > }
: > 
: > To uncomment, remove the # before the {.

The idiom would probably want to be \#{ to avoid falling afoul of the
rule that says a # in the first column is always a line-ending comment.
That's because some people would rather let their editor comment out a
block of code like this:

    #{
    #    if $baz {
    #        $foo.bar
    #    }
    #}

That has the benefit of making all the lines look like comments, and if
you're editor supports it, it's not difficult to change back.  Anyway,
we're trying to support both approaches, so use \#{...} if you want the
brackets to do the delimiting.  Maybe people will just get in the habit
of using \#{...} for all embedded comments.  I suppose we could even go
as far as to require it, but maybe that's overkill.

: 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?
:     - does it still appear in emitted code?
:     - what happens when a goto tries to enter into this block
:       or a nested sub is invoked?
:     - will the optimizer spend time on this block?

It's a comment, so it's all just whitespace as far as the parser
is concerned.

Larry

Reply via email to