This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-26
Channels
- # adventofcode (2)
- # babashka (17)
- # babashka-sci-dev (4)
- # beginners (8)
- # chlorine-clover (4)
- # clj-kondo (18)
- # clj-on-windows (1)
- # clojure (11)
- # clojure-india (12)
- # clojure-nl (1)
- # clojure-spec (9)
- # clojure-uk (3)
- # clojurescript (9)
- # conjure (3)
- # events (1)
- # graalvm (6)
- # lsp (6)
- # meander (4)
- # music (2)
- # off-topic (10)
- # other-languages (9)
- # re-frame (2)
- # releases (1)
- # reveal (8)
- # sci (1)
- # tools-deps (6)
potential cljs bug from “1.10.773”? let-binding /
(let [/ clojure.core//]
(/ 10 2))
results in
/Users/sritchie/code/clj/sicmutils/.shadow-cljs/builds/test/dev/out/cljs-runtime/sicmutils.util.permute.js:318
var ._28164 = cljs.core._SLASH_;
SyntaxError: Unexpected token '.'
at new Script (node:vm:100:7)
at createScript (node:vm:258:10)
at Object.runInThisContext (node:vm:306:10)
at global.SHADOW_IMPORT (/Users/sritchie/code/clj/sicmutils/target/main/node-tests.js:56:15)
at /Users/sritchie/code/clj/sicmutils/target/main/node-tests.js:1840:1
at Object.<anonymous> (/Users/sritchie/code/clj/sicmutils/target/main/node-tests.js:2036:3)
at Module._compile (node:internal/modules/cjs/loader:1109:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
at Module.load (node:internal/modules/cjs/loader:989:32)
at Function.Module._load (node:internal/modules/cjs/loader:829:14)
So I'm exploring clj/js interop and I create a js object in my cljs file like:
(def student #js {"locker" 212
"grades" {"Math" "A",
"Physics" nil,
"English" "A+"}})
and then in the same cljs file I updated the physics grade with: (set! (.. student -grades -Physics) "B")
So cljs is immutable so when I now evaluate student
in the repl I see that "Physics"
is still nil
but I'm seeing conflicting things in the browser console:(def student #js {"locker" 212
"grades" #js {"Math" "A",
"Physics" nil,
"English" "A+"}})