summaryrefslogtreecommitdiff
path: root/Lisp/type-handling.lisp
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2008-02-14 22:02:21 +0100
committerMatthias Benkard <code@mail.matthias.benkard.de>2008-02-14 22:02:21 +0100
commit8c5f730bddb827eaca240ed97bf396250caee30c (patch)
tree5a62168cd2daa60e87fa57e19e6cfa9dce29b5a9 /Lisp/type-handling.lisp
parent8d87e7250e5046e771a8383098032290c9a2f9b1 (diff)
Simplify the type handling API.
darcs-hash:9e2c0c2caf9589869f7894c3522a776748df38fd
Diffstat (limited to 'Lisp/type-handling.lisp')
-rw-r--r--Lisp/type-handling.lisp13
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))