mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-18 07:12:26 -08:00
In LET/LET* do not replace a read-only variable when its value is a global variable and is used more than once
This commit is contained in:
parent
50d1c9fcf7
commit
3abdab1bbb
1 changed files with 3 additions and 1 deletions
|
|
@ -170,7 +170,9 @@
|
|||
;; - the value of e2 is not modified in e3 nor in following expressions
|
||||
(when (eq (c1form-name form) 'VAR)
|
||||
(let ((other-var (c1form-arg 0 form)))
|
||||
(unless (or (member other-var rest-vars)
|
||||
(unless (or (and (global-var-p other-var)
|
||||
(> (var-ref var) 1))
|
||||
(member other-var rest-vars)
|
||||
(var-changed-in-form-list other-var rest-forms))
|
||||
(cmpdebug "Replacing variable ~A by its value ~A" (var-name var) form)
|
||||
(nsubst-var var form)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue