ok(!$res[0]->actions, 'No action');
+$solver->add_predicate(
+ catfile => [ qw(DirPath FileName FilePath) ],
+ [ qw(+ + -) ] => sub {
+ +(FilePath => [ value => File::Spec->catfile($_{DirPath}, $_{FileName}) ])
+ },
+);
+
$solver->add_rule(@$_) for (
- [ catfile => [ qw(DirPath FileName FilePath) ],
- DX::Op::FromCode->new(code => sub {
- my ($self, $state) = @_;
- my ($dir_path, $file_name, $file_path)
- = map $state->scope_var($_), qw(DirPath FileName FilePath);
- die "No." unless $dir_path->is_bound;
- die "No." unless $file_name->is_bound;
- die "No." if $file_path->is_bound;
- my $cat_file = File::Spec->catfile(
- map $_->bound_value, $dir_path, $file_name
- );
- $state->bind_value($file_path->id, $cat_file)
- ->add_dependencies(
- $file_path->id => $dir_path->id,
- $file_path->id => $file_name->id,
- )
- ->then($self->next);
- }) ],
[ file_in => [ qw(DirStatus FileName FileStatus) ],
[ is_directory => qw(DirStatus) ],
[ exists => [ qw(DirPath) ],