Given this code:How about
if ( some_expensive_lookup_function() >= $MAX_RECORDS ) {
mark_that_we_have_reached_max_records(); return;
}
After I enter that block once, I never want to evaluate the condition
again--I want the code to completely disappear from the bytecode (or,
at least, be jumped around). How would I do that in Perl 6?
$test = sub { if ( some_expensive_lookup_function() >= $MAX_RECORDS )
mark_that_we_have_reached_max_records();
$test = sub{};
};
Then call &$test() as needed;
R. -- Richard Nuttall Nuttall Consulting www.nuttall.uk.net