add atom predicate.

This commit is contained in:
Mark Thom
2018-03-10 15:26:35 -07:00
parent 2cc5367c52
commit 7500465b38
10 changed files with 248 additions and 205 deletions

View File

@@ -1350,6 +1350,14 @@ impl MachineState {
_ => self.throw_exception(functor!("type_error", 1, [heap_atom!("integer_expected")]))
};
},
&BuiltInInstruction::IsAtom(r) => {
let d = self.store(self.deref(self[r].clone()));
match d {
Addr::Con(Constant::Atom(_)) => self.p += 1,
_ => self.fail = true
};
},
&BuiltInInstruction::IsAtomic(r) => {
let d = self.store(self.deref(self[r].clone()));