diff options
Diffstat (limited to 'Lisp/type-handling.lisp')
-rw-r--r-- | Lisp/type-handling.lisp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lisp/type-handling.lisp b/Lisp/type-handling.lisp index b8ff2a2..1a299b6 100644 --- a/Lisp/type-handling.lisp +++ b/Lisp/type-handling.lisp @@ -288,3 +288,16 @@ Returns: (VALUES typespec byte-position string-position)" (t (format stream "~A" (typespec-name->type-id type-name)) (dolist (child rest) (print-typespec child stream)))))) + + +(defun typespec-nominal-type (typespec) + ;; Do the modifiers include something like (NOMINALLY :UNSIGNED-CHAR)? + ;; Return NIL if that is not the case, otherwise return the nominal + ;; type found. + (cadr (find-if #'(lambda (x) (and (consp x) + (eq (car x) 'nominally))) + (cadr typespec)))) + + +(defun typespec-primary-type (typespec) + (car typespec)) |