develooper Front page | perl.perl6.language | Postings from January 2004

run-once code

Thread Next
From:
David Storrs
Date:
January 13, 2004 20:37
Subject:
run-once code
Message ID:
20040114043721.GC99058@megazone.bigpanda.com
Given this code:
     
    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?

(I recall seeing something about how to make assertions drop out, but
I want to be able to do this at run-time, not compile-time.)

--Dks

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About