Saturday, October 22, 2005

Struct will have members

I like the idea of having structs that act in a similar way to that of normal objects, similar to the D way.

struct Test{
int $a;
sub a( $this, int $new ){
$a = $new;
}
}

Test test;
# following are equivalent
test.a(5);
test.a = 5;


The way that Perl6 handles public/private data, will also be included.
class Test{
$a is readonly;
$b is rw;
}