Created
January 11, 2012 17:54
-
-
Save monoid/1595864 to your computer and use it in GitHub Desktop.
Package reader
This file contains hidden or 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 package-reader (stream subchar arg) | |
| (declare (ignore subchar arg)) | |
| (let ((*package* (find-package (read stream)))) ; Warning! current package is polluted. | |
| (read stream))) | |
| (set-dispatch-macro-character #\# #\; #'package-reader) | |
| #| | |
| Example | |
| > (defpackage another (:use cl)) | |
| ... | |
| > #;another (list 'hi 'there) | |
| (ANOTHER::HI ANOTHER::THERE) | |
| |# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment