RosettaCodeData/Task/Special-variables/Common-Lisp/special-variables.lisp
2015-02-20 00:35:01 -05:00

12 lines
412 B
Common Lisp

(defun special-variables ()
(flet ((special-var-p (s)
(and (char= (aref s 0) #\*)
(find-if-not (lambda (x) (char= x #\*)) s)
(char= (aref s (1- (length s))) #\*))))
(let ((lst '()))
(do-symbols (s (find-package 'cl))
(when (special-var-p (symbol-name s))
(push s lst)))
lst)))
(format t "~a~%" (sort (special-variables) #'string<))