On Tue, Aug 07, 2001 at 03:00:52PM +0200, Bart Lateur wrote:
> BTW can anybody explain how the "magic" works? I mean: how comes that in
>
> use constant DEBUG => 0;
> if(DEBUG) {
> .... # things to do when debugging)
> }
>
> that the if-block is supposed to be stripped from the compiled program,
> as if DEBUG was replaced with a literal 0? Is the compiler so smart that
> it recognizes a sub that returns a constant? It'd almost have to be that
> way.
Yes. A subroutine that has an empty prototype and that simply returns a
constant value is inlined by the compiler.
Ronald
- Re: Sorting in-place pcg
- Re: Sorting in-place Abigail
- Re: Sorting in-place Michael G Schwern
- Re: Sorting in-place Ilmari Karonen
- Re: Sorting in-place pcg
- Re: Sorting in-place Ilmari Karonen
- Re: Sorting in-place Andrew Pimlott
- Re: Sorting in-place Ilmari Karonen
- Re: Sorting in-place Bart Lateur
- Re: Sorting in-place Ronald J Kimball
- Re: Sorting in-place pcg
- Re: Sorting in-place Michael G Schwern
- Re: Sorting in-place Abigail
- Re: Sorting in-place pcg
- Re: Sorting in-place Abigail
- Re: Sorting in-place Paul
- Re: Sorting in-place pcg
- Re: Sorting in-place Abigail
- Re: Sorting in-place pcg
