Skip to content

Commit

Permalink
Refactor Block.arity and Block.count; make .count return Inf.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmichaud committed Jun 29, 2010
1 parent f008ccd commit 6ea4d0c
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/core/Block.pm
@@ -1,27 +1,20 @@
augment class Block {

=begin item arity
=end item
method arity() {
my $arity = 0;
my @params = self.signature.params;
for @params -> $p {
for self.signature.params -> $p {
$arity++ unless $p.slurpy || $p.optional;
}
$arity
$arity;
}

=begin item count
=end item
method count() {
my $count = 0;
my @params = self.signature.params;
for @params -> $p {
$count++ unless $p.slurpy;
for self.signature.params -> $p {
return Inf if $p.slurpy;
$count++;
}
$count
$count;
}

method ACCEPTS(Mu $topic) {
Expand Down

0 comments on commit 6ea4d0c

Please sign in to comment.