Fix bug with :slot access
This commit is contained in:
parent
914d5dfcdc
commit
7d85c12f3a
1 changed files with 10 additions and 8 deletions
|
@ -14,14 +14,16 @@
|
||||||
(let ((expr root))
|
(let ((expr root))
|
||||||
(loop for entry on forms
|
(loop for entry on forms
|
||||||
for form = (car entry)
|
for form = (car entry)
|
||||||
do (setf expr
|
and prev-form = nil then form
|
||||||
(cond ((consp form) `(,(car form) ,expr ,@(cdr form)))
|
unless (eq prev-form :slot)
|
||||||
((eq form :slot) (prog1
|
do (setf expr
|
||||||
`(slot-value ,expr ',(cadr entry))
|
(cond ((consp form) `(,(car form) ,expr ,@(cdr form)))
|
||||||
(rplacd entry (cddr entry))))
|
((eq form :slot) (prog1 `(slot-value ,expr ',(cadr entry))
|
||||||
((symbolp form) `(,form ,expr))
|
(unless (cadr entry)
|
||||||
(t (error "Unexpected form ~S" form))
|
(error "Missing slot name"))))
|
||||||
)))
|
((symbolp form) `(,form ,expr))
|
||||||
|
(t (error "Unexpected form ~S" form)))))
|
||||||
|
;(format t "~S => ~S~%" `(O! ,root ,@forms) expr)
|
||||||
expr))
|
expr))
|
||||||
|
|
||||||
(defun read-construct (stream char arg)
|
(defun read-construct (stream char arg)
|
||||||
|
|
Loading…
Reference in a new issue