Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

constrain new vocabulary symbols in '{' reader.

  • Loading branch information...
commit 2ca0af5e47a52ba2d61e75fd52758a3ca9aa7e3b 1 parent 86ebbbc
@lisp authored
Showing with 9 additions and 2 deletions.
  1. +9 −2 reader.lisp
View
11 reader.lisp
@@ -18,6 +18,7 @@
A copy of the GNU Affero General Public License should be included with 'de.setf.resource' as `agpl.txt`.
If not, see the GNU [site](http://www.gnu.org/licenses/)."))
+(defvar *lock-vocabulary-packages* t)
(defun |{-reader|
(stream char
@@ -63,8 +64,14 @@
nil
(let* ((namespace (or (find-package namespace)
(error "Package not found: ~s." namespace)))
- (uname (or (find-symbol local-part namespace)
- (intern (subseq local-part 0) namespace))))
+ (uname (cond ((find-symbol local-part namespace))
+ (*lock-vocabulary-packages*
+ (cerror "Create a new symbol."
+ "The symbol is not present in the vocabulary: ~s: ~s."
+ local-part namespace)
+ (intern (subseq local-part 0) namespace))
+ (t
+ (intern (subseq local-part 0) namespace)))))
uname)))
(defun install-|{-reader| ()
Please sign in to comment.
Something went wrong with that request. Please try again.