Thu Dec 17 16:43:12 UTC 2009 mantoniotti * Fixed a couple of problems with some accessors in the NUMBER, Fixed a couple of problems with some accessors in the NUMBER, STRUCTURE-OBJECT and STANDARD-OBJECT templates. diff -rN -u old-cl-unification-1/templates-hierarchy.lisp new-cl-unification-1/templates-hierarchy.lisp --- old-cl-unification-1/templates-hierarchy.lisp 2013-07-24 17:30:17.000000000 +0000 +++ new-cl-unification-1/templates-hierarchy.lisp 2013-07-24 17:30:17.000000000 +0000 @@ -407,6 +407,23 @@ (cons (second spec))))) +(defun number-template-numeric-type (x) + (declare (type number-template x)) + (let ((n (number-template-number x))) + (if (numberp n) + (type-of n) + (first (template-spec x))))) + +(defun number-template-numeric-class (x) + (declare (type number-template x)) + (let ((n (number-template-number x))) + (if (numberp n) + (class-of n) + (find-class (first (template-spec x)))))) + + + + ;;; Sequence Templates. ;;; Specification is ;;; @@ -493,11 +510,19 @@ ;;; Structure and Standard Object Templates. +(defun structure-object-template-class (x) + (and (structure-object-template-p x) + (first (template-spec x)))) + (defun structure-object-template-slots (x) (and (structure-object-template-p x) (rest (template-spec x)))) +(defun standard-object-template-class (x) + (and (standard-object-template-p x) + (first (template-spec x)))) + (defun standard-object-template-slots (x) (and (standard-object-template-p x) (rest (template-spec x))))