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

Re: Perl defined Object, Array, Hash classes

Thread Previous
Larry Wall
June 13, 2005 16:34
Re: Perl defined Object, Array, Hash classes
Message ID:
You shouldn't be able to reopen/clobber an existing class/module unless
you specify

    class Object is augmented {...}
    class Object is replaced {...}

or some such (the trait names are still negotiable).  In general,
private classes should start with "my" or "our", though I don't know
if Pugs handles inner classes yet.  Also note that only the class
definition needs special scope annotation, since (unlike Perl 5), Perl
6 searches upward/outward for matching class names when you mention
something like "Object".  You can still get in trouble with an inner
Object hiding an outer Object, but at least you aren't clobbering
everyone's Object definition that way, and global Objects created
outside the scope of your private Object still know which kind of
Object they are.


Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About