Skip to content
This repository has been archived by the owner on Dec 29, 2018. It is now read-only.

Handle CLISP, fail for unknown implementations #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions src/typespecs.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@
(defun type-specifier-p (type-specifier)
"Returns true if TYPE-SPECIFIER is a valid type specfiier."
(or (documentation type-specifier 'type)
#+sbcl (sb-ext:valid-type-specifier-p type-specifier)
#+openmcl (ccl:type-specifier-p type-specifier)
#+ecl (c::valid-type-specifier type-specifier)))
(block nil
#+sbcl (return (sb-ext:valid-type-specifier-p type-specifier))
#+openmcl (return (ccl:type-specifier-p type-specifier))
#+ecl (return (c::valid-type-specifier type-specifier))
#+clisp (return (null
(nth-value 1 (ignore-errors
(ext:type-expand type-specifier)))))
(error "TYPE-SPECIFIER-P not available for this implementation"))))

(defun type-expand (type-specifier &optional env)
"Expand TYPE-SPECIFIER in the lexical environment ENV."
#+sbcl (sb-ext::typexpand type-specifier env)
#+openmcl (ccl::type-expand type-specifier env)
#-(or sbcl openmcl) type-specifier)
(or (block nil
#+sbcl (return (sb-ext::typexpand type-specifier env))
#+openmcl (return (ccl::type-expand type-specifier env))
#+clisp (return (ext:type-expand type-specifier)))
(prog1 type-specifier
(warn "TYPE-EXPAND not available for this implementation"))))