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

Re: Properties and stricture

Thread Previous | Thread Next
From:
schwern
Date:
June 5, 2001 00:58
Subject:
Re: Properties and stricture
Message ID:
20010605035842.B5205@magnonel.guild.net
On Mon, Jun 04, 2001 at 06:49:28PM -0500, Me wrote:
> Afaict, even with use strict at its most strict, perl 6
> can't (in practice) complain, at compile time, if
> 
>         $foo.Foun
> 
>     refers to an undeclared Foun.
> 
> Right?
> 
> Should there be a strict mode that warns if a
> method name matches a built in property name?

Could have one that requires all inheritance and variable declarations
occur at compile-time, but that will only effect your current scope.
Won't help against classes you inherit from doing run-time things.

And then there's autoloading...

There's also the problem of knowing at compile time what class/type
$foo is.  Don't know what's going on with that just yet, do we?


So I'd say no, Perl can't know at compile-time if your method is
declared or not.  Only in certain restricted cases, such as if you
don't inherit from anything, or if *all* your parent classes are
declared strictly.


-- 
Michael G Schwern   <schwern@pobox.com>   http://www.pobox.com/~schwern/
Perl6 Quality Assurance     <perl-qa@perl.org>       Kwalitee Is Job One

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