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

Re: Perl defined Object, Array, Hash classes

Thread Previous
From:
Larry Wall
Date:
June 13, 2005 16:34
Subject:
Re: Perl defined Object, Array, Hash classes
Message ID:
20050613233450.GA22243@wall.org
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.

Larry

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