Skip to content

Commit

Permalink
Merge branch 'nom' into newio
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Dec 23, 2014
2 parents f4d46c0 + d45c53a commit 0477e37
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
1 change: 1 addition & 0 deletions docs/ChangeLog
Expand Up @@ -2,6 +2,7 @@ New in 2015.01
+ Proper error handling for a placeholder that has already been used as
non-placeholder in the same scope
+ sub form of 'unique' introduced, 'uniq' deprecated
+ Supply.for deprecated in favour of Supply.from-list

New in 2014.12
+ Flakiness on OS X has been fixed
Expand Down
15 changes: 7 additions & 8 deletions src/core/Supply.pm
Expand Up @@ -153,17 +153,16 @@ my role Supply {

method list(Supply:D:) {
# Use a Channel to handle any asynchrony.
my $c = self.Channel;
map sub ($) {
earliest $c {
more * { $_ }
done * { last }
}
}, *;
self.Channel.list;
}

method for(Supply:U: |c) {
DEPRECATED('from-list',|<2015.01 2016.01>);
SupplyOperations.from-list(|c);
}

method on_demand(Supply:U: |c) { SupplyOperations.on_demand(|c) }
method for(Supply:U: |c) { SupplyOperations.for(|c) }
method from-list(Supply:U: |c) { SupplyOperations.from-list(|c) }
method interval(Supply:U: |c) { SupplyOperations.interval(|c) }
method flat(Supply:D: ) { SupplyOperations.flat(self) }
method grep(Supply:D: Mu $test) { SupplyOperations.grep(self, $test) }
Expand Down
6 changes: 3 additions & 3 deletions src/core/SupplyOperations.pm
Expand Up @@ -69,8 +69,8 @@ my class SupplyOperations is repr('Uninstantiable') {
OnDemandSupply.new(:&producer, :&closing, :$scheduler)
}

method for(*@values, :$scheduler = CurrentThreadScheduler) {
my class ForSupply does Supply {
method from-list(*@values, :$scheduler = CurrentThreadScheduler) {
my class FromListSupply does Supply {
has @!values;
has $!scheduler;

Expand All @@ -93,7 +93,7 @@ my class SupplyOperations is repr('Uninstantiable') {
$sub
}
}
ForSupply.new(:@values, :$scheduler)
FromListSupply.new(:@values, :$scheduler)
}

method interval($interval, $delay = 0, :$scheduler = $*SCHEDULER) {
Expand Down

0 comments on commit 0477e37

Please sign in to comment.