diff --git a/shop3/decls.lisp b/shop3/decls.lisp index 89e6594e..0df8efd0 100644 --- a/shop3/decls.lisp +++ b/shop3/decls.lisp @@ -913,3 +913,12 @@ task keyword of TASK and LIBRARY-TASK are the same.") (member thing '(&optional &rest) :test #'eq))) (if (find-if #'rest-or-optional-p types) `(values ,@types) `(values ,@types &optional)))) + +;;;--------------------------------------------------------------------------- +;;; CL:CHECK-TYPE messes up SBCL's type checking, because on continuation +;;; it allows the user to supply an object of a new type. Change it to just +;;; raise a type error. [2024/08/02:rpg] +;;;--------------------------------------------------------------------------- +(defmacro check-type (place type) + `(unless (typep ,place ',type) + (error 'type-error :datum ,place :expected-type ',type))) diff --git a/shop3/package.lisp b/shop3/package.lisp index 8fa18812..c1b36efb 100644 --- a/shop3/package.lisp +++ b/shop3/package.lisp @@ -63,6 +63,8 @@ (:documentation "The SHOP3 package is the package that exposes SHOP3's API.") (:use :common-lisp :shop3.unifier :shop3.common :shop3.theorem-prover :iterate) + ;; override this... + (:shadow #:check-type) (:import-from #:shop3.common #:domain-core) (:import-from #:shop3.theorem-prover #:+numerical-comparisons+ #:fluent-value