From dfc34e6e71c344694e0286a21166d6894c071819 Mon Sep 17 00:00:00 2001 From: Yogthos Date: Mon, 22 Jun 2026 01:19:21 -0400 Subject: [PATCH] spec: set! now supports deftype mutable fields --- docs/spec/03-special-forms.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/spec/03-special-forms.md b/docs/spec/03-special-forms.md index 2bb4f5b..3a19e3f 100644 --- a/docs/spec/03-special-forms.md +++ b/docs/spec/03-special-forms.md @@ -151,5 +151,5 @@ S1–S3, E1 → jolt `forms-spec` let group; clojure-test-suite | `var` | `#'` reader sugar; resolution at compile time | | `throw` | any value vs Throwable — host question; jolt/cljs allow data, reference requires Throwable → classification needed | | `try/catch/finally` | catch dispatch order, `:default`-style catch-all is a dialect extension (⚠ divergence note), finally evaluation guarantees, value of try | -| `set!` | `(set! *var* val)` sets the var's innermost thread binding, else its root, and returns val (implemented); a local (deftype mutable field) or host `(.-field obj)` target is host-dependent | +| `set!` | three targets, all implemented: `(set! *var* val)` sets the var's innermost thread binding (else root); `(set! field val)` inside a `deftype` method mutates a `^:unsynchronized-mutable`/`^:volatile-mutable` field in place; `(set! (.-field obj) val)` does the same via interop syntax. Returns val | | `.` / `new` | syntax only; behavior host-defined |