On Thu, Jan 09, 2003 at 07:55:20PM -0500, John Siracusa wrote:
> Has there been any discussion of how to create code in Perl 6 that's there
> under some conditions, but not there under others? I'm thinking of the
> spiritual equivalent of #ifdef, only Perlish.
>
> In Perl 5, there were many attempts to use such a feature for debugging and
> assertions. What everyone wanted to do was write code like this:
>
> debug("Doing foo with $bar and $baz");
> foo($bar, $baz);
I would assume it to be a compiler hint via subroutine attribute.
sub debug ($msg) is off {
print STDERR $msg;
}
some "this subroutine is a no-op if a flag is set" attribute.
--
Michael G. Schwern <[EMAIL PROTECTED]> http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One