parrotcode: testing object oriented features | |
Contents | Language Implementations | Pipp |
oo.t - testing object oriented features
Defining and using objects.
class Foo {
has $.member is rw;
# default value for members is not implemented yet in Rakudo
method set_member() {
$.member = 'a member of Foo';
}
method echo_member() {
print $.member;
print "\n";
}
}
my Foo $foo .= new(); $foo.set_member(); $foo.echo_member();
|