diff options
author | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-03-03 17:30:30 +0100 |
---|---|---|
committer | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-03-03 17:30:30 +0100 |
commit | 68041467b00a878bd7325bf2f385bd58de7a2a20 (patch) | |
tree | 15f82768e35b599317b037874feaa47165fc98a9 /Lisp | |
parent | 644d70511f705264dd181626f3b306c87da0ac32 (diff) |
Add function TYPESPEC.
darcs-hash:f36f563a44c43c4fdf5d7c354ea4937afd91eb16
Diffstat (limited to 'Lisp')
-rw-r--r-- | Lisp/name-conversion.lisp | 2 | ||||
-rw-r--r-- | Lisp/type-handling.lisp | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/Lisp/name-conversion.lisp b/Lisp/name-conversion.lisp index bec232b..eb46ee4 100644 --- a/Lisp/name-conversion.lisp +++ b/Lisp/name-conversion.lisp @@ -199,4 +199,4 @@ (defun name-hyphenated->nerd-caps (string) - (remove #\- (string-capitalise-lower-case string))) + (remove #\- (string-capitalise-lower-case string)))
\ No newline at end of file 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))) |