Fork me on GitHub
#clojure
<
2022-12-27
>
lilactown18:12:22

(defprotocol IFoo
  (bar [foo]))

(def ^:dynamic *dynamic*)

(deftype DynamicFoo [^:volatile-mutable baz]
  IFoo
  (bar [this]
    (binding [*dynamic* 84]
      (set! baz 42))
    baz))
this throws an error that baz is not a mutable field. is this expected? doing any of the following seems to resolve the error: • move the set! outside of the binding • move the return of baz inside the binding • change it to (set! (.-this baz) 42) inside the binding

lilactown19:12:39

that looks like the culprit. thanks!

👍 1
Eugen20:12:47

I posted this on #kit-clj - but it might be related to clojure docker image https://clojurians.slack.com/archives/C02T4GSBSJ1/p1672173230776419 . Trying build an image for arm64 on amd64 platform using buildx . Any experiences with this ?

lispyclouds20:12:31

you probably need the multi platform capable buildx. we use this in the babashka build: https://github.com/babashka/babashka/blob/master/.circleci/script/short_ci.clj#L196

👀 1
Eugen20:12:24

thanks, I think that helped but the underlying issue seems to be some changes from java 11 to java 17 https://stackoverflow.com/questions/61301818/java-failed-to-exec-spawn-helper-error-since-moving-to-java-14-on-linux

Eugen20:12:23

+ git does not seem to be installed on clojure temurin bullseye image - though a lot of packages are using clojure git deps

Eugen20:12:40

will see what I cand do to make it work on Java 17 and get back