smalltalk: mandelbrot + literal-array mutability fix
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
This commit is contained in:
@@ -150,9 +150,15 @@
|
||||
((= ty "lit-true") true)
|
||||
((= ty "lit-false") false)
|
||||
((= ty "lit-array")
|
||||
(map
|
||||
(fn (e) (smalltalk-eval-ast e frame))
|
||||
(get ast :elements)))
|
||||
;; map returns an immutable list — Smalltalk arrays must be
|
||||
;; mutable so that `at:put:` works. Build via append! so each
|
||||
;; literal yields a fresh mutable list.
|
||||
(let ((out (list)))
|
||||
(begin
|
||||
(for-each
|
||||
(fn (e) (append! out (smalltalk-eval-ast e frame)))
|
||||
(get ast :elements))
|
||||
out)))
|
||||
((= ty "lit-byte-array") (get ast :elements))
|
||||
((= ty "self") (get frame :self))
|
||||
((= ty "super") (get frame :self))
|
||||
|
||||
Reference in New Issue
Block a user