diff --git a/src/prolog/io.rs b/src/prolog/io.rs index 9d12260e..8459f116 100644 --- a/src/prolog/io.rs +++ b/src/prolog/io.rs @@ -267,7 +267,7 @@ impl fmt::Display for EvalError { &EvalError::ModuleDoesNotContainExport => write!(f, "module does not contain claimed export."), &EvalError::QueryFailure => write!(f, "false."), &EvalError::QueryFailureWithException(ref e) => write!(f, "{}", error_string(e)), - &EvalError::ImpermissibleEntry(ref msg) => write!(f, "cannot overwrite builtin {}.", msg), + &EvalError::ImpermissibleEntry(ref msg) => write!(f, "cannot overwrite {}.", msg), &EvalError::OpIsInfixAndPostFix => write!(f, "cannot define an op to be both postfix and infix."), &EvalError::NamelessEntry => write!(f, "the predicate head is not an atom or clause."), diff --git a/src/prolog/machine/mod.rs b/src/prolog/machine/mod.rs index efce38ce..f9c1a621 100644 --- a/src/prolog/machine/mod.rs +++ b/src/prolog/machine/mod.rs @@ -190,12 +190,10 @@ impl Machine { -> EvalSession { match self.code_dir.get(&(name.clone(), arity)) { - Some(&CodeIndex (ref idx)) => - if idx.borrow().1 == clause_name!("builtin") { + Some(&CodeIndex (ref idx)) if idx.borrow().1 != clause_name!("user") => return EvalSession::from(EvalError::ImpermissibleEntry(format!("{}/{}", name, - arity))) - }, + arity))), _ => {} };