mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-23 04:52:42 -08:00
When replacing a variable with a form, only the first value is used
This commit is contained in:
parent
f6bddc7b0b
commit
9f842084bc
1 changed files with 4 additions and 12 deletions
|
|
@ -498,24 +498,16 @@
|
|||
|
||||
(defun nsubst-var (var form)
|
||||
(when (var-set-nodes var)
|
||||
(baboon "Cannot replace a variable that is to be changed"))
|
||||
(baboon :format-control "Cannot replace a variable that is to be changed"))
|
||||
(when (var-functions-reading var)
|
||||
(baboon "Cannot replace a variable that is closed over"))
|
||||
(baboon :format-control "Cannot replace a variable that is closed over"))
|
||||
(when (rest (var-read-nodes var))
|
||||
(baboon "Cannot replace a variable that is used more than once"))
|
||||
;; FIXME!!!!
|
||||
;; Only take the first value out of the form
|
||||
#+nil
|
||||
(setf form (make-c1form* 'VALUES :args (list form)))
|
||||
(baboon :format-control "Cannot replace a variable that is used more than once"))
|
||||
(let ((where (first (var-read-nodes var))))
|
||||
(unless (and (eql (c1form-name where) 'VAR)
|
||||
(eql (c1form-arg 0 where) var))
|
||||
(baboon "VAR-READ-NODES are only C1FORMS of type VAR"))
|
||||
#+(or)
|
||||
(baboon :format-control "VAR-READ-NODES are only C1FORMS of type VAR"))
|
||||
(setf (var-read-nodes var) nil
|
||||
(var-set-nodes var) nil
|
||||
(var-functions-setting var) nil
|
||||
(var-functions-reading var) nil
|
||||
(var-ref var) 0
|
||||
(var-ignorable var) t)
|
||||
(c1form-replace-with where form)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue