package DX::Predicate::MemberAt;
-use DX::Utils qw(step INDICES_OF EXISTENCE_OF CONTENTS_OF);
+use DX::Utils qw(step INDICES_OF EXISTENCE_OF CONTENTS_OF string);
use DX::Class;
with 'DX::Role::Predicate';
),
($key->can_set_value
? map {
- my $set_key = $key->action_for_set_value($_);
+ my $set_key = $key->action_for_set_value(string(my $kstr = $_));
map $_->but_first($set_key)
->but_with_dependencies_on(
[ undef ,=>
- [ EXISTENCE_OF ,=> $coll, $key->string_value ]
+ [ EXISTENCE_OF ,=> $coll, $kstr ]
]
),
$self->_make_equal($coll->get_member_at($_), $value);
has alternative_step => (is => 'ro', isa => Step);
+sub but_first {
+ my ($self, @actions) = @_;
+ $self->but(actions => [ @actions, @{$self->actions} ]);
+}
+
sub but_with_dependencies_on {
my ($self, @deps) = @_;
$self->but(depends_on => [ @{$self->depends_on}, @deps ]);