Perl 6 Perl 6 today #60

Type objects

Declaring a class creates a "type object" for the class

The type object is not the class itself -- it's an empty instance

Normal methods (that don't depend on state) can be used

Typically use .new for a new instance:

my $fido = Dog.new();

Can also specify initial attribute values:

my $pet = Puppy.new( name => 'Rosey', color => 'white' );
Copyright © 2009
http://www.pmichaud.com/2009/pres/