projects
/
gitmo/Class-MOP.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
7694f98273ad89b423b6c59a6e35c5e75440c196
[gitmo/Class-MOP.git]
/
bench
/
lib
/
MOP
/
Immutable
/
Point.pm
1
2
package MOP::Immutable::Point;
3
4
use strict;
5
use warnings;
6
use metaclass;
7
8
__PACKAGE__->meta->add_attribute('x' => (accessor => 'x', default => 10));
9
__PACKAGE__->meta->add_attribute('y' => (accessor => 'y'));
10
11
sub new {
12
my $class = shift;
13
$class->meta->new_object(@_);
14
}
15
16
sub clear {
17
my $self = shift;
18
$self->x(0);
19
$self->y(0);
20
}
21
22
__PACKAGE__->meta->make_immutable;
23
24
1;
25
26
__END__