Subject: | Clarify if this module does optree culling |
One of the biggest benefits of Perl constants is that they can be
optimised in branches at compile time, removing code that can't be
reached and making it faster.
use constant WIN32 => ($^O' eq Win32');
while ( 1 ) {
if ( WIN32 ) { # This is optimised away
# This is run
} else {
# This is compiled away
}
}
While the code used to produce the constant is compiled away in the
constant::defer case, the documentation does not make it clear if this
optree-culling/currying of the rest of your code occurs in the same way
as for normal constants.
Clarifying this in the documentation would be appreciated.