The Hyperspec contains the list of all 978 external Common Lisp
symbols.
And CLtL II contained separate lists of all the functions, macros,
global vars, etc, but those lists aren't in the Hyperspec that I can
find.
A simple Google search didn't turn up anything obvious.
Anyone have these lists (for ANSI CL) online and willing to share?
······@alum.mit.edu (JP Massar) writes:
> The Hyperspec contains the list of all 978 external Common Lisp
> symbols. And CLtL II contained separate lists of all the functions,
> macros, global vars, etc, but those lists aren't in the Hyperspec
> that I can find.
;;; Functions
(loop for sym being each external-symbol of 'common-lisp
when (and (fboundp sym)
(not (or (special-operator-p sym) (macro-function sym))))
collect sym)
;;; Macros
(loop for sym being each external-symbol of 'common-lisp
when (macro-function sym) collect sym)
;;; Variables and constants
(loop for sym being each external-symbol of 'common-lisp
when (boundp sym) collect sym)
;;; Special operators
(loop for sym being each external-symbol of 'common-lisp
when (special-operator-p sym) collect sym)
--
Lars Brinkhoff, Services for Unix, Linux, GCC, PDP-10, HTTP
Brinkhoff Consulting http://www.brinkhoff.se/
On 06 Mar 2003 08:05:20 +0100, Lars Brinkhoff <·········@nocrew.org>
wrote:
>······@alum.mit.edu (JP Massar) writes:
>> The Hyperspec contains the list of all 978 external Common Lisp
>> symbols. And CLtL II contained separate lists of all the functions,
>> macros, global vars, etc, but those lists aren't in the Hyperspec
>> that I can find.
>
>;;; Functions
>(loop for sym being each external-symbol of 'common-lisp
> when (and (fboundp sym)
> (not (or (special-operator-p sym) (macro-function sym))))
> collect sym)
>
>;;; Macros
>(loop for sym being each external-symbol of 'common-lisp
> when (macro-function sym) collect sym)
>
>;;; Variables and constants
>(loop for sym being each external-symbol of 'common-lisp
> when (boundp sym) collect sym)
>
>;;; Special operators
>(loop for sym being each external-symbol of 'common-lisp
> when (special-operator-p sym) collect sym)
>
Indeed.
But that only works if the implementation is correct.
I wanted a 'meta-list' that I know to be correct.
On 06 Mar 2003 14:41:47 -0800, Kevin Layer
<·····@*n*o*s*p*a*m*franz.com> wrote:
>······@alum.mit.edu (JP Massar) writes:
>
>> The Hyperspec contains the list of all 978 external Common Lisp
>> symbols.
>>
>> And CLtL II contained separate lists of all the functions, macros,
>> global vars, etc, but those lists aren't in the Hyperspec that I can
>> find.
>>
>> A simple Google search didn't turn up anything obvious.
>>
>> Anyone have these lists (for ANSI CL) online and willing to share?
>
>Sure:
>
>(export '(
>&allow-other-keys
You provided the list of all 978 external symbols.
What I want is separate lists
-- One naming all the functions
-- one naming all the macros
-- one naming all the globals and constants
See for instance CLtL II pp. 1018, 1019
······@alum.mit.edu (JP Massar) writes:
> What I want is separate lists
>
> -- One naming all the functions
> -- one naming all the macros
> -- one naming all the globals and constants
>
> See for instance CLtL II pp. 1018, 1019
Unless someone can provide a better list this ugly hack might be a
starting point:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(in-package #:cl-user)
(defpackage #:temp (:use #:cl))
(in-package #:temp)
(defparameter *clhs-root* "/usr/local/lib/LispWorks/lib/4-2-0-0/manual/online/web/CLHS/Body/")
(defun un-html (string)
(loop for (entity length replacement) in '(("&" 5 "&")
("<" 4 "<")
(">" 4 ">"))
for found = (search entity string)
if found
do (return (concatenate 'string
(subseq string 0 found)
replacement
(subseq string (+ found length))))
finally (return string)))
(defun get-page (file-name)
(with-open-file (stream (merge-pathnames file-name *clhs-root*))
(let ((string (make-string (file-length stream))))
(read-sequence string stream)
string)))
(defparameter *symbol-hash* nil)
(defun parse-symbols (file-name tag)
(loop with skip = (1+ (length tag))
with page = (get-page file-name)
for index = 0 then less-than
for link = (+ (or (search tag page :start2 index)
(return))
skip)
for quote = (position #\" page :start link)
for less-than = (position #\< page :start quote)
for first-char = (char page link)
for symbol = (intern (un-html (subseq page (+ quote 2) less-than)) '#:cl)
unless (char= first-char #\2)
do (setf (gethash symbol *symbol-hash*)
(case first-char
((#\d)
"Declaration")
((#\e)
"Condition")
((#\f)
"Function")
((#\m)
"Macro")
((#\r)
"Restart")
((#\s)
"Special Operator")
((#\t)
"Type")
((#\v)
"Variable")
((#\a #\0)
"Go figure")))))
(defun get-symbols ()
(let ((*symbol-hash* (make-hash-table :test #'eq)))
(parse-symbols "01_i.htm" "REL=DEFINITION HREF=")
(loop for symbol in
(sort
(loop for symbol being the hash-keys of *symbol-hash*
collect symbol)
#'string<)
do (format t "~40A: ~A~%" symbol (gethash symbol *symbol-hash*))))
(values))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Cheers,
Edi.