From: Stevan Little Date: Wed, 26 Jul 2006 20:43:15 +0000 (+0000) Subject: the circle is now complete X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fattic%2Fiterative;p=gitmo%2FClass-MOP.git the circle is now complete --- diff --git a/lib/Class/MOP.pm b/lib/Class/MOP.pm index f32f15a..f97b142 100644 --- a/lib/Class/MOP.pm +++ b/lib/Class/MOP.pm @@ -165,23 +165,34 @@ Class::MOP::Attribute->meta->add_attribute( ## Class::MOP::Iterator -=pod - Class::MOP::Iterator->meta->add_attribute( Class::MOP::Attribute->new('generator' => ( - accessor => 'generator', + accessor => { + # NOTE: we need to do this in order + # not fall into meta-circular death + 'generator' => sub { + my $self = shift; + $self->{generator} = shift if @_; + $self->{generator}; + } + } )), ); Class::MOP::Iterator->meta->add_attribute( Class::MOP::Attribute->new('predicate' => ( - accessor => 'predicate', + accessor => { + # NOTE: we need to do this in order + # not fall into meta-circular death + 'predicate' => sub { + my $self = shift; + $self->{predicate} = shift if @_; + $self->{predicate}; + } + } )), ); -=cut - - # NOTE: (meta-circularity) # This should be one of the last things done # it will "tie the knot" with Class::MOP::Attribute