start enabling the dynamic database

This commit is contained in:
Mark Thom
2019-02-28 21:49:07 -07:00
parent 9db7172bfe
commit 818a971833
16 changed files with 510 additions and 167 deletions

View File

@@ -25,6 +25,13 @@ 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 }
@@ -153,6 +160,19 @@ 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