Skip to content

Commit

Permalink
Fix %use-syntax to work for values other than package designators.
Browse files Browse the repository at this point in the history
Fixes m2ym#10
  • Loading branch information
tmccombs committed Jul 21, 2014
1 parent bdb271c commit bc2a874
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/operators.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
(defun package-syntax-name (package)
(intern *standard-package-syntax-name* package)))

(defun get-options (name)
"Get the options list for name, if it is available."
(get (cond ((typep name 'syntax) nil)
((and (typep name 'package-designator)
(find-package name))
(package-syntax-name name))
(t name))
:options))

(defmacro defsyntax (name &body options)
`(progn
(setf (get ',name :options) ',options)
Expand Down Expand Up @@ -33,7 +42,7 @@
(setq *readtable* (copy-readtable))
(loop for name in names
for syntax = (find-syntax name)
for options = (get (package-syntax-name name) :options)
for options = (get-options name)
if (assoc :fuze (if (consp (car options)) options (cdr options))) do
(handler-bind ((named-readtables:reader-macro-conflict
(lambda (_) (declare (ignore _))
Expand Down

0 comments on commit bc2a874

Please sign in to comment.