From 68041467b00a878bd7325bf2f385bd58de7a2a20 Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Mon, 3 Mar 2008 17:30:30 +0100 Subject: Add function TYPESPEC. darcs-hash:f36f563a44c43c4fdf5d7c354ea4937afd91eb16 --- Lisp/name-conversion.lisp | 2 +- Lisp/type-handling.lisp | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'Lisp') 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))) -- cgit v1.2.3