diff --git a/docs/ChangeLog b/docs/ChangeLog index c49f66ad77a..200919decea 100644 --- a/docs/ChangeLog +++ b/docs/ChangeLog @@ -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 diff --git a/src/core/Supply.pm b/src/core/Supply.pm index 795196b48b1..795f19dfc22 100644 --- a/src/core/Supply.pm +++ b/src/core/Supply.pm @@ -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) } diff --git a/src/core/SupplyOperations.pm b/src/core/SupplyOperations.pm index 8f2a2db43e9..548cf881ea4 100644 --- a/src/core/SupplyOperations.pm +++ b/src/core/SupplyOperations.pm @@ -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; @@ -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) {