最简单的情况
`
user=>
(deftype Bench [#^{:unsynchronized-mutable true} val]
Runnable
(run [_]
(fn [] (set! val 5))))
java.lang.IllegalArgumentException: Cannot assign to non-mutable: val (NO_SOURCE_FILE:5)
`
函数应该能够在其周围的定义类型(deftype)中修改可变字段(就像Java中的内部类一样)。
由于循环特殊形式有时会展开成一个fn形式,因此已作为错误报告
`
user=>
(deftype Bench [#^{:unsynchronized-mutable true} val]
Runnable
(run [_]
(let [x (loop [] (set! val 5))])))
java.lang.IllegalArgumentException: Cannot assign to non-mutable: val (NO_SOURCE_FILE:9)
`