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 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?

The important question here is this one:

 - when 'uncommented', is it a no-op?

Which isn't true for #{}/{}, because {} introduces new lexical
scope. It's still a pretty good idea, but it's not as good as the C
preprocessor. if (0) has the same problem. Pod doesn't. Anybody able
to think up a non-pod construct that doesn't affect the code it wraps? 
(Solutions which involve complicated modules are acceptable, so long
as the usage is not complicated and there is no run-time penalty)

Reply via email to