Skip to content

Instantly share code, notes, and snippets.

@monoid
Created January 11, 2012 17:54
Show Gist options
  • Select an option

  • Save monoid/1595864 to your computer and use it in GitHub Desktop.

Select an option

Save monoid/1595864 to your computer and use it in GitHub Desktop.
Package reader
(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