make chars callable (#713)

This commit is contained in:
Mark Thom
2021-03-17 19:50:41 -06:00
parent 6c23d7aec8
commit 10af206024
2 changed files with 13 additions and 1 deletions

View File

@@ -1711,6 +1711,7 @@ impl MachineState {
return None;
}
}
Addr::Char(c) => (clause_name!(c.to_string(), self.atom_tbl), 0),
Addr::Con(h) => match &self.heap[h] {
HeapCellValue::Atom(ref name, _) => (name.clone(), 0),
_ => {
@@ -1726,7 +1727,7 @@ impl MachineState {
self.throw_exception(instantiation_error);
return None;
}
_ => {
addr => {
let stub = MachineError::functor_stub(clause_name!("call"), arity + 1);
let type_error = self.error_form(
MachineError::type_error(self.heap.h(), ValidType::Callable, addr),