Perl 6 Cool Perl 6 #94

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 © 2010
http://www.pmichaud.com/2010/pres/