Phoenix.pm: Perl 6 Apocalypse 12
Andrew Johnson
aj at exiledplanet.org
Thu Apr 29 14:43:11 CDT 2004
It's been a couple of weeks since Larry Wall releaed Perl 6 Apocalypse
12, in which he explains the Perl 6 object model. It's rather long
(supposedly 80 printed pages). Given our recent discussion on Perl 6
syntax, I wondered if anyone in the group had any thoughts on the new
Apocalypse?
Since I brought up the subject, I can start the discussion:
Likes:
*I really like the basic syntax choices. You declare a class by using
'class', and methods by using 'method'. They're still packages and subs
underneath, but Perl 6 takes care of that for you.
*There is a default constructor, so you don't have to declare new()
methods in every class structure you create.
*The annoyance of '$self=shift' in every method is gone; $.attrname
will automatically mean the 'attrname' value of the current object.
Dislikes:
*Secondary Sigils. Yuck. Class methods especially seem complicated
with them.
* I think the syntax:
my Dog $spot .= new(...)
looks _awful_. Of course, one does not have to use that syntax, but
stuff like that is going to trip up Java/C/Perl 5 programmers, IMHO.
Confusion:
*I'm still a bit unclear about how traits, properties, and roles work.
Traits sort of look a bit like Java interfaces, but not exactly.
Somebody apparently likes them enough to port them to Perl 5 though:
http://search.cpan.org/~stevan/Class-Trait-0.03/
Remember, this is all my US$0.02. Comments? Questions? Explanations?
More information about the Phoenix-pm
mailing list