},
&InlinedQueryTerm::IsCompound(ref inner_term) =>
match inner_term[0].as_ref() {
- &Term::Clause(..) => {
+ &Term::Clause(..) | &Term::Cons(..) => {
code.push(succeed!());
},
&Term::Var(ref vr, ref name) => {
if !target.is_empty() {
code.push(Line::Query(target));
}
-
+
code.push(is_call!(temp_v!(1), at.unwrap_or(interm!(1))));
},
&Term::Constant(_, ref c @ Constant::Number(_)) => {
let d = self.store(self.deref(self[r].clone()));
match d {
- Addr::Str(_) => self.p += 1,
+ Addr::Str(_) | Addr::Lis(_) => self.p += 1,
_ => self.fail = true
};
},
self.fail = !self.structural_eq_test(),
_ => self.compare_term(qt)
};
-
+
self.p = self.cp;
},
&ControlInstruction::Deallocate => {
&ControlInstruction::DuplicateTermExecute => {
self.duplicate_term();
self.p = self.cp;
- },
+ },
&ControlInstruction::DynamicIs => {
let a = self[temp_v!(1)].clone();
let result = try_or_fail!(self, self.arith_eval_by_metacall(temp_v!(2)));
assert_prolog_success!(&mut wam, "?- compound(functor(compound)).");
assert_prolog_success!(&mut wam, "?- compound(f(X)).");
+ assert_prolog_success!(&mut wam, "?- compound([1,2,3]).");
+ assert_prolog_failure!(&mut wam, "?- compound([]).");
assert_prolog_failure!(&mut wam, "?- compound(3.14159269).");
assert_prolog_failure!(&mut wam, "?- compound(3).");
assert_prolog_failure!(&mut wam, "?- compound(\"sdfsa\").");
assert_prolog_failure!(&mut wam, "?- compound(atom).");
- assert_prolog_failure!(&mut wam, "?- compound([1,2,3]).");
- assert_prolog_failure!(&mut wam, "?- compound([1,2,X]).");
assert_prolog_failure!(&mut wam, "?- string(functor(string)).");
assert_prolog_failure!(&mut wam, "?- string(3.14159269).");