Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Kebab-case Supply.on_demand/schedule_on
Deprecate the original ones, of course.
  • Loading branch information
lizmat committed Mar 12, 2015
1 parent 357ad26 commit eecf5c9
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
1 change: 1 addition & 0 deletions docs/ChangeLog
Expand Up @@ -25,6 +25,7 @@ using the new names as described above.
- Implemented UInt (sub)type and coercer.
- Smart quotes (as in “foo”, ‘bar’, ‚baz’ and „zap”) now also supported.
- Many native improvements, e.g. allowing ++ on native ints.
- Deprecated Supply.on_demand/schedule_on in favour of on-demand/schedule-on.
- Various compile time error message improvements.

New in 2015.02
Expand Down
33 changes: 20 additions & 13 deletions src/core/Supply.pm
Expand Up @@ -156,19 +156,14 @@ my role Supply {
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 on-demand(Supply:U: |c) { SupplyOperations.on-demand(|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) }
method map(Supply:D: &mapper) { SupplyOperations.map(self, &mapper) }
method schedule_on(Supply:D: Scheduler $scheduler) {
SupplyOperations.schedule_on(self, $scheduler);
method schedule-on(Supply:D: Scheduler $scheduler) {
SupplyOperations.schedule-on(self, $scheduler);
}
method start(Supply:D: &startee) { SupplyOperations.start(self, &startee) }
method stable(Supply:D: $time, :$scheduler = $*SCHEDULER) {
Expand Down Expand Up @@ -214,11 +209,6 @@ my role Supply {
}
}

method uniq(Supply:D: |c) {
DEPRECATED('unique', |<2014.11 2015.11>);
self.unique(|c);
}

method unique(Supply:D $self: :&as, :&with, :$expires) {
on -> $res {
$self => do {
Expand Down Expand Up @@ -783,6 +773,23 @@ my role Supply {
}
}
}

method for(Supply:U: |c) {
DEPRECATED('from-list',|<2015.01 2016.01>);
SupplyOperations.from-list(|c);
}
method on_demand(Supply:U: |c) {
DEPRECATED('on-demand',|<2015.03 2016.03>);
SupplyOperations.on-demand(|c);
}
method schedule_on(Supply:D: Scheduler $scheduler) {
DEPRECATED('schedule-on',|<2015.03 2016.03>);
SupplyOperations.schedule-on(self, $scheduler);
}
method uniq(Supply:D: |c) {
DEPRECATED('unique', |<2014.11 2015.11>);
self.unique(|c);
}
}

# The on meta-combinator provides a mechanism for implementing thread-safe
Expand Down
4 changes: 2 additions & 2 deletions src/core/SupplyOperations.pm
Expand Up @@ -35,7 +35,7 @@ my class SupplyOperations is repr('Uninstantiable') {
}
}

method on_demand(&producer, :&closing, :$scheduler = CurrentThreadScheduler) {
method on-demand(&producer, :&closing, :$scheduler = CurrentThreadScheduler) {
my class OnDemandSupply does Supply {
has &!producer;
has &!closing;
Expand Down Expand Up @@ -191,7 +191,7 @@ my class SupplyOperations is repr('Uninstantiable') {
MapSupply.new(:$source, :&mapper)
}

method schedule_on(Supply $source, Scheduler $scheduler) {
method schedule-on(Supply $source, Scheduler $scheduler) {
my class ScheduleSupply does Supply does PrivatePublishing {
has $!source;
has $!scheduler;
Expand Down

0 comments on commit eecf5c9

Please sign in to comment.