switch next predicate to mutating searchstate instead of using alt_step
Matt S Trout [Mon, 20 Jun 2016 00:49:50 +0000 (00:49 +0000)]
lib/DX/Step/InvokeNextPredicate.pm

index 3e969e9..dc9aab1 100644 (file)
@@ -9,7 +9,10 @@ has proposition => (is => 'ro', required => 1);
 sub apply_to {
   my ($self, $ss) = @_;
   my $hyp = $ss->current_hypothesis;
-  return (undef, $self->proposition->resolve_for($hyp->scope));
+  if (my $step = $self->proposition->resolve_for($hyp->scope)) {
+    return $ss->but(next_step => $step);
+  }
+  return undef;
 }
 
 1;