X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/b9d603a074ce320686143ef4e18b990e3791b4bf..2e01fd8b00192c3ace8df389749e73c63b647a79:/doc/list-exports.lisp diff --git a/doc/list-exports.lisp b/doc/list-exports.lisp index 5cb8600..eab4d54 100644 --- a/doc/list-exports.lisp +++ b/doc/list-exports.lisp @@ -1,3 +1,8 @@ +(cl:defpackage #:sod-exports + (:use #:common-lisp)) + +(cl:in-package #:sod-exports) + (defun symbolicate (&rest things) (intern (apply #'concatenate 'string (mapcar #'string things)))) @@ -9,7 +14,7 @@ (declare (ignore head tail)) nil)) -(defmethod form-list-exports ((head (eql 'export)) tail) +(defmethod form-list-exports ((head (eql 'cl:export)) tail) (let ((symbols (car tail))) (if (and (consp symbols) (eq (car symbols) 'quote)) @@ -17,7 +22,7 @@ (if (atom thing) (list thing) thing)) (incomprehensible-form head tail)))) -(defmethod form-list-exports ((head (eql 'definst)) tail) +(defmethod form-list-exports ((head (eql 'sod:definst)) tail) (destructuring-bind (code (streamvar &key export) args &body body) tail (declare (ignore streamvar body)) (and export @@ -27,20 +32,20 @@ (symbolicate 'inst- arg)) args))))) -(defmethod form-list-exports ((head (eql 'define-tagged-type)) tail) +(defmethod form-list-exports ((head (eql 'sod::define-tagged-type)) tail) (destructuring-bind (kind what) tail (declare (ignore what)) (list kind (symbolicate 'c- kind '-type) (symbolicate 'make- kind '-type)))) -(defmethod form-list-exports ((head (eql 'macrolet)) tail) +(defmethod form-list-exports ((head (eql 'cl:macrolet)) tail) (mapcan #'form-exports (cdr tail))) -(defmethod form-list-exports ((head (eql 'eval-when)) tail) +(defmethod form-list-exports ((head (eql 'cl:eval-when)) tail) (mapcan #'form-exports (cdr tail))) -(defmethod form-list-exports ((head (eql 'progn)) tail) +(defmethod form-list-exports ((head (eql 'cl:progn)) tail) (mapcan #'form-exports tail)) (defgeneric form-exports (form) @@ -69,7 +74,8 @@ (defun find-symbol-homes (paths package) (let* ((symbols (list-exported-symbols package)) - (exports-alist (mapcan #'list-exports paths)) + (exports-alist (let ((*package* package)) + (mapcan #'list-exports paths))) (homes (make-hash-table :test #'equal))) (dolist (assoc exports-alist) (let ((home (car assoc))) @@ -403,6 +409,7 @@ (analyse-generic-functions package) (terpri)) +(export 'report-project-symbols) (defun report-project-symbols () (labels ((components (comp) (slot-value comp 'asdf::components)) @@ -428,3 +435,8 @@ (report-symbols (mapcar #'file-name parser-files) "SOD-PARSER") (report-symbols (mapcar #'file-name (list optparse)) "OPTPARSE") (report-symbols (mapcar #'file-name (list utilities)) "SOD-UTILITIES")))) + +#+interactive +(with-open-file (*standard-output* #p"doc/SYMBOLS" :direction :output + :if-exists :supersede :if-does-not-exist :create) + (report-project-symbols))