Created
April 9, 2015 11:57
-
-
Save lispm/082860afd06a6209fc76 to your computer and use it in GitHub Desktop.
Retrieving Source Code from a running Clozure CL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun retrieve-source-code (&optional (package *package*)) | |
(do-symbols (s package) | |
(multiple-value-bind (symbol where) | |
(find-symbol (symbol-name s) | |
package) | |
(declare (ignore symbol)) | |
(when (member where '(:internal :external)) | |
(let ((ds (find-definition-sources s))) | |
(when (and ds (listp ds)) | |
(loop for (nil sn) in ds | |
for snt = (source-note-text sn) | |
when snt do (progn | |
(terpri) | |
(princ snt) | |
(terpri))))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment