smalltalk: mandelbrot + literal-array mutability fix
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled

This commit is contained in:
2026-04-25 06:57:03 +00:00
parent a446d31d0d
commit 7c5c49c529
4 changed files with 123 additions and 4 deletions

View File

@@ -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))