improve length/2 (#1325)

This commit is contained in:
Mark Thom
2022-03-15 18:43:57 -06:00
parent d06b5f7ab5
commit 895b02b641
5 changed files with 84 additions and 7 deletions

View File

@@ -257,6 +257,19 @@ impl MachineState {
}
}
pub(super) fn resource_error(&mut self, value: HeapCellValue) -> MachineError {
let stub = functor!(
atom!("resource_error"),
[atom(atom!("finite_memory")), cell(value)]
);
MachineError {
stub,
location: None,
from: ErrorProvenance::Received,
}
}
pub(super) fn type_error<T: TypeError>(
&mut self,
valid_type: ValidType,