Subject: | AI::Prolog returns unblessed result objects |
Here's the screenshot and the sample code used was copied from
AI::Prolog's documentation. It's interesting to see there's no
corresponding test in your test suite since all tests are passing on my
macine.
D:\projects\Pugs2>perl test.pl
Can't call method "X" on unblessed reference at test.pl line 7.
D:\projects\Pugs2>type test.pl
use AI::Prolog;
use Data::Dumper;
my $prolog = AI::Prolog->new(append_prog());
$prolog->query("append(X,Y,[a,b,c,d])");
while (my $result = $prolog->results) {
print Dumper($result->X); # array references
#print Dumper($result->{X});
}
sub append_prog {
return <<' END_PROLOG';
append([], X, X).
append([W|X],Y,[W|Z]) :- append(X,Y,Z).
END_PROLOG
}