develooper Front page | perl.perl6.language | Postings from June 2001

Re: Properties and stricture

Thread Previous | Thread Next
From:
Piers Cawley
Date:
June 6, 2001 00:41
Subject:
Re: Properties and stricture
Message ID:
m3u21uf44p.fsf@iest.bofh.org.uk
Michael G Schwern <schwern@pobox.com> writes:
> Consider the following... Foo is a poster-child for a strict class.
> Everything is predeclared and typed.  Its entire hierarchy is rock
> solid.  Someone uses Foo in their script and calls Foo->bar.  They
> also use Bar, a module you installed a long time ago.  Bar does this:
> 
>         package Bar;
>         eval "sub Foo::bar { 23 }";
> 
> Oh crap!  All the wonderful compile-time checking we did on Foo has
> just been blown to pieces.

Well, if Damian's suggestions for strict classes in perl 5+i becomes
anything more than fiction then that eval will throw an exception.

-- 
Piers Cawley
www.iterative-software.com


Thread Previous | 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