diff options
author | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-02-14 22:02:21 +0100 |
---|---|---|
committer | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-02-14 22:02:21 +0100 |
commit | 8c5f730bddb827eaca240ed97bf396250caee30c (patch) | |
tree | 5a62168cd2daa60e87fa57e19e6cfa9dce29b5a9 /Lisp/type-handling.lisp | |
parent | 8d87e7250e5046e771a8383098032290c9a2f9b1 (diff) |
Simplify the type handling API.
darcs-hash:9e2c0c2caf9589869f7894c3522a776748df38fd
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)) |