my ($member, $of) = @args{qw(member of)};
die "member bound" if $member->is_bound;
my $set = $state->facts->{$of->bound_value};
- return $state->bind_root_set_then($member->id, $set, $self->next)
- ->add_dependencies($member->id, $of->id);
+ return $state->then($self->next)
+ ->add_dependencies($member->id, $of->id)
+ ->bind_root_set($member->id, $set)
}
1;
);
}
-sub bind_stream_then {
- my ($self, $var, $stream, $then) = @_;
+sub bind_stream {
+ my ($self, $var, $stream) = @_;
my $bound = $var->with_stream($stream);
$self->but(
by_id => { %{$self->by_id}, $var->id => $bound },
- next_op => $then
)->mark_choice($bound);
}
-sub bind_root_set_then {
- my ($self, $var_id, $set, $then) = @_;
+sub bind_root_set {
+ my ($self, $var_id, $set) = @_;
my $bound = $self->by_id->{$var_id}->with_root_set($set);
$self->but(
by_id => { %{$self->by_id}, $var_id => $bound },
- next_op => $then
)->mark_choice($bound);
}
my ($var, $array) = @_;
sub {
my ($self, $state) = @_;
- $state->bind_stream_then(
+ $state->then($self->next)->bind_stream(
$state->scope_var($var),
ArrayStream->from_array(@$array),
- $self->next
)
}
}