root set bind by id
Matt S Trout [Mon, 3 Feb 2014 11:59:21 +0000 (11:59 +0000)]
lib/DX/Op/MemberOf.pm
lib/DX/State.pm

index 776ecf9..7da83b8 100644 (file)
@@ -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;
index 106bbfc..6fd62a2 100644 (file)
@@ -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);
 }