use strictures 1;
use Test::More;
-use Unknown::Values;
use List::Util qw(reduce);
use aliased 'DX::Op::FromCode';
use DX::Var;
die "key unbound" unless $key->is_bound;
die "thing bound" if $thing->is_bound;
if (my $value = $set->{$key->bound_value}) {
- return $state->bind_var_then($thing, $value, $self->next);
+ return $state->bind_value($thing, $value)->then($self->next);
}
return $state->backtrack;
}
code => sub { $_[1]->but(scope => $scope, next_op => $_[0]->next) },
next => $self->next,
);
- $state->but(
- scope => { %$scope },
- return_stack => [ @{$state->return_stack}, $ret_op ],
- next_op => $inner_op
- )->assign_vars(%vars);
+ $state->but(scope => { %$scope })
+ ->push_return_then($ret_op, $inner_op)
+ ->assign_vars(%vars);
};
}
die "WTH";
}
} @arg_spec;
- $state->but(
- scope => {},
- return_stack => [ @{$state->return_stack}, $ret_op ],
- next_op => FromCode->new(
- code => sub { $option->(@_, @args) },
- next => $pop_ret,
- ),
+ my $next_op = FromCode->new(
+ code => sub { $option->(@_, @args) },
+ next => $pop_ret,
);
+ $state->but(scope => {})
+ ->push_return_then($ret_op, $next_op);
};
}