Oto porównanie Cor i Moose. Przykładowy kod:
klasa Punkt {
ma ( $x, $y ) :czytelnik :pisarz :nowy :isa(Int);
metoda clear() {
( x, y ) = ( 0, 0 );
}
}
klasa Point3D jest punktem {
ma $z :reader :writer :new :isa(Int);
metoda clear() {
$self->next::metoda;
z = 0;
}
}
Źródło: linux.org.ru
