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

Too late to run CHECK block.

Thread Next
From:
Piers Cawley
Date:
January 29, 2001 03:25
Subject:
Too late to run CHECK block.
Message ID:
m3ae8asioi.fsf_-_@iest.bofh.org.uk
So, I'm trying to write some code which ensures at compile time that,
if a class claims to implement a given interface, then all the methods
of said interface are actually implemented.

So, in the 'implements' module I have a CHECK block that checks that
all the methods requested by the interface are accessible. No problem.

Until, one of my class's client classes comes to do a deferred load
using require and everything falls over in a heap because it's 

    Too late to run CHECK block.

And I can't, for the life of me, understand why. Surely there's still
a seperation between the compilation of the required module and any
runtime behaviour, so there should be room to run the appropriate
CHECK and INIT blocks.

And if there isn't, is there any way of working out within my
'implements' module that it's going to be too late to run a CHECK
block? 

-- 
Piers


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