Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Code esthetics: make Supply parameter $s
  • Loading branch information
lizmat committed Apr 23, 2014
1 parent 3018590 commit fcedf60
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/core/SupplyOperations.pm
Expand Up @@ -80,7 +80,7 @@ my class SupplyOperations is repr('Uninstantiable') {
IntervalSupply.new(:$interval, :$delay, :$scheduler)
}

method flat(Supply $a) {
method flat(Supply $s) {
my class FlatSupply does Supply does PrivatePublishing {
has $!source;

Expand All @@ -97,16 +97,16 @@ my class SupplyOperations is repr('Uninstantiable') {
$sub
}
}
FlatSupply.new(:source($a))
FlatSupply.new(:source($s))
}

method do($a, &side_effect) {
method do($s, &side_effect) {
on -> $res {
$a => sub (\val) { side_effect(val); $res.more(val) }
$s => sub (\val) { side_effect(val); $res.more(val) }
}
}

method grep(Supply $a, &filter) {
method grep(Supply $s, &filter) {
my class GrepSupply does Supply does PrivatePublishing {
has $!source;
has &!filter;
Expand All @@ -125,12 +125,12 @@ my class SupplyOperations is repr('Uninstantiable') {
$sub
}
}
GrepSupply.new(:source($a), :&filter)
GrepSupply.new(:source($s), :&filter)
}

method uniq(Supply $a, :&as, :&with, :$expires) {
method uniq(Supply $s, :&as, :&with, :$expires) {
on -> $res {
$a => do {
$s => do {
if $expires {
if &with and &with !=== &[===] {
my @seen; # really Mu, but doesn't work in settings
Expand Down Expand Up @@ -163,7 +163,7 @@ my class SupplyOperations is repr('Uninstantiable') {
}
}
else {
@seen.push: ($target, $now+$expires);
@seen.push: (val, $now+$expires);
$res.more(val);
}
};
Expand Down Expand Up @@ -235,10 +235,10 @@ my class SupplyOperations is repr('Uninstantiable') {
}
}

method squish(Supply $a, :&as, :&with is copy) {
method squish(Supply $s, :&as, :&with is copy) {
&with //= &[===];
on -> $res {
$a => do {
$s => do {
my Mu $last = @secret;
my Mu $target;
&as
Expand All @@ -259,7 +259,7 @@ my class SupplyOperations is repr('Uninstantiable') {
}
}

method map(Supply $a, &mapper) {
method map(Supply $s, &mapper) {
my class MapSupply does Supply does PrivatePublishing {
has $!source;
has &!mapper;
Expand All @@ -277,7 +277,7 @@ my class SupplyOperations is repr('Uninstantiable') {
$sub
}
}
MapSupply.new(:source($a), :&mapper)
MapSupply.new(:source($s), :&mapper)
}

method rotor(Supply $s, $elems is copy, $overlap is copy ) {
Expand Down

0 comments on commit fcedf60

Please sign in to comment.