develooper Front page | perl.perl5.porters | Postings from January 2001

Re: Too late to run CHECK block.

Thread Previous
From:
Gurusamy Sarathy
Date:
January 29, 2001 08:50
Subject:
Re: Too late to run CHECK block.
Message ID:
200101291649.f0TGnm415301@smtp3.ActiveState.com
On 29 Jan 2001 16:27:12 GMT, Piers Cawley wrote:
>Gurusamy Sarathy <gsar@ActiveState.com> writes:
>> In the current implementation, there is exactly one point at which
>> CHECK and INIT blocks are run (this being the point at which the
>> Compiler would do its work, when it saves and restores program
>> state, respectively).
>> 
>> But I believe Larry has stated that CHECK blocks should be able to
>> run at the end of compilation of every individual "compilation unit",
>> whatever that happens to be (file/BEGIN block/eval"").  Will those
>> semantics be useful for you?
>
>That would definitely be handy to have. It's certainly the behaviour I
>expected.

It's not clear then how the Compiler should do the checkpointing,
given that it needs to do its thing from a module.  It would seem
to need a mechanism to postpone CHECK block execution to the end
of compilation of the main script (as opposed to the end of
compilation of the current unit).

Alternatively, there may be value in adding attributes:

    CHECK :local {...}
    INIT :local {...}

Or maybe run with the current semantics when they do:

    CHECK :global {...}
    INIT :global {...}

(but that has a compatibility issue).


Sarathy
gsar@ActiveState.com

Thread Previous


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