separate scope setup in rule bodies into its own op
[scpubgit/DKit.git] / lib / DX / Op / CallRule.pm
index f3d1b4f..17deac0 100644 (file)
@@ -26,9 +26,8 @@ sub run {
   my $invoke = DX::Op::FromCode->new(
     code => sub {
       my ($self, $state) = @_;
-      my ($names, $body) = @{$var->bound_value};
-      my %new; @new{@$names} = @args;
-      $state->but(scope => {})->assign_vars(%new)->then($body);
+      my $call = $var->bound_value->but(args => \@args);
+      $state->but(scope => {})->then($call);
     }
   );
   my $ret_op = DX::Op::SetScope->new(