From: Matt S Trout Date: Mon, 3 Feb 2014 11:59:21 +0000 (+0000) Subject: root set bind by id X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1b6999dadd0def5d974bf926442fc8c87b2e1108;p=scpubgit%2FDKit.git root set bind by id --- diff --git a/lib/DX/Op/MemberOf.pm b/lib/DX/Op/MemberOf.pm index 776ecf9..7da83b8 100644 --- a/lib/DX/Op/MemberOf.pm +++ b/lib/DX/Op/MemberOf.pm @@ -17,7 +17,7 @@ sub run { 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, $set, $self->next); + return $state->bind_root_set_then($member->id, $set, $self->next); } 1; diff --git a/lib/DX/State.pm b/lib/DX/State.pm index 106bbfc..6fd62a2 100644 --- a/lib/DX/State.pm +++ b/lib/DX/State.pm @@ -75,10 +75,10 @@ sub bind_stream_then { } sub bind_root_set_then { - my ($self, $var, $set, $then) = @_; - my $bound = $var->with_root_set($set); + my ($self, $var_id, $set, $then) = @_; + my $bound = $self->by_id->{$var_id}->with_root_set($set); $self->but( - by_id => { %{$self->by_id}, $var->id => $bound }, + by_id => { %{$self->by_id}, $var_id => $bound }, next_op => $then )->mark_choice($bound); }