add assertz/1 and asserta/1

This commit is contained in:
Mark Thom
2019-03-02 00:27:40 -07:00
parent 818a971833
commit 2fb5408ab5
10 changed files with 238 additions and 36 deletions

View File

@@ -25,13 +25,6 @@ impl MachineError {
functor!("/", 2, [name, heap_integer!(arity)], (400, YFX))
}
pub(super) fn static_modification_error(perm_error: PermissionError, culprit: Addr) -> Self {
let stub = functor!("permission_error", 3, [heap_atom!(perm_error.as_str()),
heap_atom!("static_procedure"),
HeapCellValue::Addr(culprit)]);
MachineError { stub, from: ErrorProvenance::Received }
}
pub(super) fn evaluation_error(eval_error: EvalError) -> Self {
let stub = functor!("evaluation_error", 1, [heap_atom!(eval_error.as_str())]);
MachineError { stub, from: ErrorProvenance::Received }
@@ -160,19 +153,6 @@ impl ValidType {
}
}
#[derive(Clone, Copy)]
pub enum PermissionError {
Modify
}
impl PermissionError {
pub fn as_str(self) -> &'static str {
match self {
PermissionError::Modify => "modify"
}
}
}
#[derive(Clone, Copy)]
pub enum DomainError {
NotLessThanZero