Perl 6 Perl 6 today #59

Inheritance

The is keyword handles inheritance (and other things):

class Puppy is Dog {
    method bark() { say "yap"; }  # override

    method chew($item) {          # new method
        $item.damage;
    }
}

Multiple inheritance also uses is:

class Puppy is Dog is Pet { ... }
Copyright © 2009
http://www.pmichaud.com/2009/pres/