);
}
-sub bind_var_then {
- my ($self, $var, $value, $then) = @_;
+sub bind_value {
+ my ($self, $var, $value) = @_;
my $bound = $var->with_value($value);
$self->but(
by_id => { %{$self->by_id}, $var->id => $bound },
- next_op => $then
);
}
my $set_dot_ssh = FromCode->new(
code => sub {
my ($self, $state) = @_;
- $state->bind_var_then($state->scope_var('P'), '/home/me/.ssh', $self->next);
+ $state->bind_value($state->scope_var('P'), '/home/me/.ssh')
+ ->then($self->next);
}
);
code => sub {
my ($self, $state) = @_;
if (my $p = $paths{$state->scope_var('P')->bound_value}) {
- return $state->bind_var_then($state->scope_var('PS'), $p, $self->next);
+ return $state->bind_value($state->scope_var('PS'), $p)
+ ->then($self->next);
}
return $state->backtrack;
}
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;
}