use DX::Action::SetBoundValue;
use DX::Action::AddBoundValue;
+use DX::Utils qw(:event_types);
use DX::Class;
with 'DX::Role::ActionBuilder';
sub can_set_value { shift->inner_action_builder->can_set_value }
+sub aperture_for_set_value {
+ my ($self) = @_;
+ return [] unless $self->can_set_value;
+ [
+ [ VALUE_SET ,=> @{$self->target_path} ],
+ @{$self->inner_action_builder->aperture_for_set_value},
+ ]
+}
+
sub action_for_set_value {
my ($self, $value) = @_;
my $inner_action = $self->inner_action_builder->action_for_set_value($value);
sub can_add_member { shift->inner_action_builder->can_add_member }
+sub aperture_for_add_member {
+ my ($self, $at) = @_;
+ return [] unless $self->can_add_member;
+ [
+ [ VALUE_SET ,=> @{$self->target_path} ],
+ @{$self->inner_action_builder->aperture_for_add_member($at)},
+ ]
+}
+
sub action_for_add_member {
my ($self, $at, $value) = @_;
$at = $at->string_value if ref($at);
use DX::Action::SetValue;
use DX::Action::AddValue;
+use DX::Utils qw(:event_types);
use DX::Class;
with 'DX::Role::ActionBuilder';
has target_path => (is => 'ro', required => 1);
+sub aperture_for_set_value {
+ [ [ VALUE_SET ,=> @{$_[0]->target_path} ] ]
+}
+
sub action_for_set_value {
my ($self, $value) = @_;
DX::Action::SetValue->new(
);
}
+sub aperture_for_add_member {
+ my ($self, $at) = @_;
+ [ [ VALUE_EXISTS ,=> @{$self->target_path}, $at ] ]
+}
+
sub action_for_add_member {
my ($self, $at, $value) = @_;
my $ab = $self->specialize_for_member($at);
sub can_set_value { 0 }
+sub aperture_for_set_value { [] }
+
sub action_for_set_value { undef }
sub can_add_member { 0 }
+sub aperture_for_add_member { [] }
+
sub action_for_add_member { undef }
+sub aperure_for_set_member { [] }
+
sub action_for_set_member { undef }
+sub aperture_for_remove_member { [] }
+
sub action_for_remove_member { undef }
sub specialize_for_member {
package DX::ActionBuilder::ProxySetToAdd;
+use DX::Utils qw(VALUE_SET);
use DX::Class;
with 'DX::Role::ActionBuilder';
has proxy_to => (is => 'ro', required => 1);
+sub aperture_for_set_value {
+ my ($self) = @_;
+ [
+ [ VALUE_SET ,=> @{$self->target_path} ],
+ @{$self->proxy_to->aperture_for_add_member($self->target_path->[-1])}
+ ]
+}
+
sub action_for_set_value {
my ($self, $value) = @_;
$self->proxy_to->action_for_add_member($self->target_path->[-1], $value);
use DX::ActionBuilder::Normal;
use DX::Action::BindValue;
use DX::ActionBuilder::BoundValue;
+use DX::Utils qw(VALUE_SET);
use DX::Class;
with 'DX::Role::ActionBuilder';
has target_path => (is => 'ro', required => 1);
+sub aperture_for_set_value {
+ [ [ VALUE_SET ,=> @{$_[0]->target_path} ] ]
+}
+
sub action_for_set_value {
my ($self, $value) = @_;
if (my $p = $value->value_path) {
return rspace(
geometry_depends_on => $deps,
+ aperture => $arg->aperture_for_set_value,
members => [ res(
actions => $actions,
veracity_depends_on => $deps
my $deps = [ [ CONTENTS_OF ,=> $left ], [ CONTENTS_OF ,=> $right ] ];
+ my $aperture = [ map @{$_->aperture_for_set_value}, $left, $right ];
+
if ($left->equals($right)) {
return rspace(
geometry_depends_on => $deps,
+ aperture => $aperture,
members => [
res(
actions => [],
return rspace(
geometry_depends_on => $deps,
+ aperture => $aperture,
members => \@members,
);
}
);
return rspace(
+ aperture => [],
geometry_depends_on => $deps,
members => \@members
);
[ CONTENTS_OF ,=> $dict, $key->string_value ],
[ TYPE_OF ,=> $value ],
],
+ aperture => $value->aperture_for_set_value,
members => [
res(
actions => [ $value->action_for_set_value($cur_val) ],
return rspace(
geometry_depends_on => $deps,
+ aperture => $value->aperture_for_set_value,
members => [
res(
actions => [
geometry_depends_on => [
[ EXISTENCE_OF ,=> $dict, $key->string_value ],
],
+ aperture => [],
members => [],
);
[ TYPE_OF ,=> $key ],
[ TYPE_OF ,=> $value ],
],
+ aperture => [ map @{$_->aperture_for_set_value}, $key, $value ],
members => [
rstrat(
action_prototypes => [
has geometry_depends_on => (is => 'ro', required => 1);
+has aperture => (is => 'ro', required => 1);
+
has members => (is => 'ro', required => 1);
+sub for_deparse {
+ my ($self) = @_;
+ [ statement => [
+ [ symbol => 'rspace' ],
+ [ block => $self->members ],
+ ] ];
+}
+
sub next_resolution {
my ($self) = @_;
return undef unless my ($first) = @{$self->members};
has action_builder => (
is => 'ro',
default => 'DX::ActionBuilder::Null',
- handles => [ qw(can_set_value action_for_set_value) ],
+ handles => [ qw(can_set_value aperture_for_set_value action_for_set_value) ],
);
sub value_path { shift->action_builder->target_path }