From 44cf16e51191f69640f5962501ac69a9421cc386 Mon Sep 17 00:00:00 2001 From: Hakim Cassimally Date: Tue, 21 Jun 2011 09:07:53 +0100 Subject: [PATCH] remove filter_no_if, as it doesn't work --- code/perl/moose/lib/List.pm | 8 ++++++++ code/perl/moose/t/chapter_01/01_list.t | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/code/perl/moose/lib/List.pm b/code/perl/moose/lib/List.pm index 4628921..24515d0 100644 --- a/code/perl/moose/lib/List.pm +++ b/code/perl/moose/lib/List.pm @@ -107,6 +107,11 @@ role List { } } +=begin doesnt' work + +# at that time, $self is still MooseX::Method::Signatures::Meta::Method +# rather than the $self in the signature + multi method filter_no_if (List::Empty $self: CodeRef $f) { return $self; } @@ -120,6 +125,9 @@ role List { tail_call $self->tail->filter( $f ); } +=end +=cut + multi method foldl (List::Empty $self: CodeRef $f, $acc) { return $acc; } diff --git a/code/perl/moose/t/chapter_01/01_list.t b/code/perl/moose/t/chapter_01/01_list.t index 5bb5712..cf7d27e 100644 --- a/code/perl/moose/t/chapter_01/01_list.t +++ b/code/perl/moose/t/chapter_01/01_list.t @@ -52,7 +52,6 @@ is $names->nth(0), 'Bob Smith', 'map ok'; is $names->nth(1), 'Aisha Chaudhury', 'map ok'; my $filtered = $list->filter( sub { (shift) % 2 }); - is $filtered->head, 11, 'odd filter'; is $filtered->nth(1), 13, 'odd filter';