summaryrefslogtreecommitdiff
path: root/Lisp/type-handling.lisp
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2008-03-03 17:30:30 +0100
committerMatthias Benkard <code@mail.matthias.benkard.de>2008-03-03 17:30:30 +0100
commit68041467b00a878bd7325bf2f385bd58de7a2a20 (patch)
tree15f82768e35b599317b037874feaa47165fc98a9 /Lisp/type-handling.lisp
parent644d70511f705264dd181626f3b306c87da0ac32 (diff)
Add function TYPESPEC.
darcs-hash:f36f563a44c43c4fdf5d7c354ea4937afd91eb16
Diffstat (limited to 'Lisp/type-handling.lisp')
-rw-r--r--Lisp/type-handling.lisp10
1 files changed, 8 insertions, 2 deletions
diff --git a/Lisp/type-handling.lisp b/Lisp/type-handling.lisp
index 45aaf22..dfb84e7 100644
--- a/Lisp/type-handling.lisp
+++ b/Lisp/type-handling.lisp
@@ -230,6 +230,12 @@ Returns: (VALUES typespec byte-position string-position)"
(values typespec nil string-position))))
+(defun typespec (typespec-designator)
+ (etypecase typespec-designator
+ (symbol (list typespec-designator ()))
+ (list typespec-designator)))
+
+
(defun print-typespec-to-string (typespec)
(with-output-to-string (out)
(print-typespec typespec out)))
@@ -238,7 +244,7 @@ Returns: (VALUES typespec byte-position string-position)"
(defun print-typespec (typespec &optional (stream *standard-output*))
"Convert a TYPESPEC into a typestring and write the result to a STREAM."
(destructuring-bind (type-name modifiers &rest rest)
- typespec
+ (typespec typespec)
(dolist (modifier modifiers)
(format stream "~A" (case modifier
(const #\r)
@@ -299,4 +305,4 @@ Returns: (VALUES typespec byte-position string-position)"
(defun typespec-primary-type (typespec)
- (car typespec))
+ (car (typespec typespec)))