Skip to content

Commit

Permalink
Merge pull request #1221 from MasterDuke17/normalize_proto_bodies
Browse files Browse the repository at this point in the history
Normalize proto bodies
  • Loading branch information
zoffixznet committed Nov 3, 2017
2 parents 264eef7 + 733d50c commit 2cadb2b
Show file tree
Hide file tree
Showing 23 changed files with 240 additions and 240 deletions.
54 changes: 27 additions & 27 deletions src/core/Any-iterable-methods.pm
Expand Up @@ -8,7 +8,7 @@
use MONKEY-TYPING;
augment class Any {

proto method map(|) is nodal { * }
proto method map(|) is nodal {*}
multi method map(Hash \h) {
die "Cannot map a {self.^name} to a {h.^name}.
Did you mean to add a stub (\{...\}) or did you mean to .classify?"
Expand Down Expand Up @@ -767,7 +767,7 @@ Did you mean to add a stub (\{...\}) or did you mean to .classify?"
)
}

proto method flatmap (|) is nodal { * }
proto method flatmap (|) is nodal {*}
multi method flatmap(&block, :$label) {
self.map(&block, :$label).flat
}
Expand Down Expand Up @@ -992,7 +992,7 @@ Did you mean to add a stub (\{...\}) or did you mean to .classify?"
)
}

proto method grep(|) is nodal { * }
proto method grep(|) is nodal {*}
multi method grep(Bool:D $t) {
X::Match::Bool.new( type => '.grep').throw
}
Expand Down Expand Up @@ -1065,7 +1065,7 @@ Did you mean to add a stub (\{...\}) or did you mean to .classify?"
}
}

proto method first(|) is nodal { * }
proto method first(|) is nodal {*}
multi method first(Bool:D $t) {
Failure.new(X::Match::Bool.new( type => '.first' ))
}
Expand Down Expand Up @@ -1177,7 +1177,7 @@ Did you mean to add a stub (\{...\}) or did you mean to .classify?"
)
}

proto method min (|) is nodal { * }
proto method min (|) is nodal {*}
multi method min() {
nqp::stmts(
nqp::if(
Expand Down Expand Up @@ -1211,7 +1211,7 @@ Did you mean to add a stub (\{...\}) or did you mean to .classify?"
)
}

proto method max (|) is nodal { * }
proto method max (|) is nodal {*}
multi method max() {
nqp::stmts(
nqp::if(
Expand Down Expand Up @@ -1288,7 +1288,7 @@ Did you mean to add a stub (\{...\}) or did you mean to .classify?"
)
}

proto method minmax (|) is nodal { * }
proto method minmax (|) is nodal {*}
multi method minmax() {
nqp::stmts(
nqp::if(
Expand Down Expand Up @@ -1391,7 +1391,7 @@ Did you mean to add a stub (\{...\}) or did you mean to .classify?"
)
}

proto method sort(|) is nodal { * }
proto method sort(|) is nodal {*}
multi method sort() {
nqp::if(
nqp::eqaddr(
Expand Down Expand Up @@ -1459,14 +1459,14 @@ Did you mean to add a stub (\{...\}) or did you mean to .classify?"
)
}

proto method reduce(|) { * }
proto method reduce(|) {*}
multi method reduce(&with) is nodal {
return unless self.DEFINITE;
my $reducer := find-reducer-for-op(&with);
$reducer(&with)(self) if $reducer;
}

proto method produce(|) { * }
proto method produce(|) {*}
multi method produce(&with) is nodal {
return unless self.DEFINITE;
my $reducer := find-reducer-for-op(&with);
Expand Down Expand Up @@ -1781,7 +1781,7 @@ Did you mean to add a stub (\{...\}) or did you mean to .classify?"
}.new(self, &with))
}

proto method pairup(|) is nodal { * }
proto method pairup(|) is nodal {*}
multi method pairup(Any:U:) { () }
multi method pairup(Any:D:) {
my \iter := self.iterator;
Expand Down Expand Up @@ -1810,7 +1810,7 @@ Did you mean to add a stub (\{...\}) or did you mean to .classify?"
}
}

proto method head(|) { * }
proto method head(|) {*}
multi method head(Any:D:) is raw {
nqp::if(
nqp::eqaddr((my $pulled := self.iterator.pull-one),IterationEnd),
Expand All @@ -1827,7 +1827,7 @@ Did you mean to add a stub (\{...\}) or did you mean to .classify?"
Seq.new(Rakudo::Iterator.NextNValues(self.iterator,$n))
}

proto method tail(|) { * }
proto method tail(|) {*}
multi method tail(Any:D:) is raw {
nqp::if(
nqp::eqaddr((my $pulled :=
Expand All @@ -1852,7 +1852,7 @@ Did you mean to add a stub (\{...\}) or did you mean to .classify?"
)
}

proto method minpairs(|) { * }
proto method minpairs(|) {*}
multi method minpairs(Any:D:) {
my @found;
for self.pairs {
Expand All @@ -1870,7 +1870,7 @@ Did you mean to add a stub (\{...\}) or did you mean to .classify?"
Seq.new(@found.iterator)
}

proto method maxpairs(|) { * }
proto method maxpairs(|) {*}
multi method maxpairs(Any:D:) {
my @found;
for self.pairs {
Expand All @@ -1888,30 +1888,30 @@ Did you mean to add a stub (\{...\}) or did you mean to .classify?"
Seq.new(@found.iterator)
}

proto method batch(|) is nodal { * }
proto method batch(|) is nodal {*}
multi method batch(Any:D: Int:D :$elems!) {
Seq.new(Rakudo::Iterator.Batch(self.iterator,$elems,1))
}
multi method batch(Any:D: Int:D $batch) {
Seq.new(Rakudo::Iterator.Batch(self.iterator,$batch,1))
}

proto method rotor(|) is nodal { * }
proto method rotor(|) is nodal {*}
multi method rotor(Any:D: Int:D $batch, :$partial) {
Seq.new(Rakudo::Iterator.Batch(self.iterator,$batch,$partial))
}
multi method rotor(Any:D: *@cycle, :$partial) {
Seq.new(Rakudo::Iterator.Rotor(self.iterator,@cycle,$partial))
}

proto method skip(|) { * }
proto method skip(|) {*}
multi method skip() { Seq.new(self.iterator).skip }
multi method skip(Int() $n) { Seq.new(self.iterator).skip($n) }
}

BEGIN Attribute.^compose;

proto sub infix:<min>(|) is pure { * }
proto sub infix:<min>(|) is pure {*}
multi sub infix:<min>(Mu:D \a, Mu:U) { a }
multi sub infix:<min>(Mu:U, Mu:D \b) { b }
multi sub infix:<min>(Mu:D \a, Mu:D \b) { (a cmp b) < 0 ?? a !! b }
Expand All @@ -1922,7 +1922,7 @@ multi sub infix:<min>(num \a, num \b) { nqp::if(nqp::islt_i(nqp::cmp_n(a, b)
multi sub infix:<min>(+args is raw) { args.min }
sub min(+args, :&by = &infix:<cmp>) { args.min(&by) }

proto sub infix:<max>(|) is pure { * }
proto sub infix:<max>(|) is pure {*}
multi sub infix:<max>(Mu:D \a, Mu:U) { a }
multi sub infix:<max>(Mu:U, Mu:D \b) { b }
multi sub infix:<max>(Mu:D \a, Mu:D \b) { (a cmp b) > 0 ?? a !! b }
Expand All @@ -1933,7 +1933,7 @@ multi sub infix:<max>(num \a, num \b) { nqp::if(nqp::isgt_i(nqp::cmp_n(a, b)
multi sub infix:<max>(+args) { args.max }
sub max(+args, :&by = &infix:<cmp>) { args.max(&by) }

proto sub infix:<minmax>(|) is pure { * }
proto sub infix:<minmax>(|) is pure {*}
multi sub infix:<minmax>(+args) { args.minmax }
sub minmax(+args, :&by = &infix:<cmp>) { args.minmax(&by) }

Expand All @@ -1951,22 +1951,22 @@ proto sub first(|) {*}
multi sub first(Bool:D $t, |) { Failure.new(X::Match::Bool.new(:type<first>)) }
multi sub first(Mu $test, +values, *%a) { values.first($test,|%a) }

proto sub join(|) { * }
proto sub join(|) {*}
multi sub join($sep = '', *@values) { @values.join($sep) }

proto sub reduce (|) { * }
proto sub reduce (|) {*}
multi sub reduce (&with, +list) { list.reduce(&with) }

proto sub produce (|) { * }
proto sub produce (|) {*}
multi sub produce (&with, +list) { list.produce(&with) }

proto sub unique(|) { * }
proto sub unique(|) {*}
multi sub unique(+values, |c) { my $laze = values.is-lazy; values.unique(|c).lazy-if($laze) }

proto sub squish(|) { * }
proto sub squish(|) {*}
multi sub squish(+values, |c) { my $laze = values.is-lazy; values.squish(|c).lazy-if($laze) }

proto sub repeated(|) { * }
proto sub repeated(|) {*}
multi sub repeated(+values, |c) { my $laze = values.is-lazy; values.repeated(|c).lazy-if($laze) }

proto sub sort(|) {*}
Expand Down

0 comments on commit 2cadb2b

Please sign in to comment.