This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-20
Channels
- # aleph (1)
- # announcements (1)
- # aws (11)
- # babashka (117)
- # beginners (34)
- # calva (13)
- # cider (3)
- # clj-commons (8)
- # clj-kondo (24)
- # clj-yaml (36)
- # cljsrn (46)
- # clojure (50)
- # clojure-australia (5)
- # clojure-europe (239)
- # clojure-nl (3)
- # clojure-norway (3)
- # clojure-spec (16)
- # clojurescript (25)
- # core-typed (20)
- # cursive (41)
- # datahike (1)
- # datalevin (1)
- # datomic (17)
- # fulcro (27)
- # hyperfiddle (35)
- # introduce-yourself (1)
- # jobs (4)
- # lsp (20)
- # malli (8)
- # meander (8)
- # nbb (1)
- # off-topic (31)
- # parinfer (9)
- # pathom (3)
- # portal (2)
- # re-frame (20)
- # react (2)
- # reagent (8)
- # releases (1)
- # remote-jobs (4)
- # scittle (2)
- # shadow-cljs (8)
- # slack-help (4)
- # sql (30)
- # squint (3)
- # tools-deps (34)
- # xtdb (21)
Hi. Given a symbol, can I resolve it to its value? e.g., in Clojure at runtime you can @(resolve 'foo/bar)
. This is not possible at runtime in cljs, correct? Is it possible at compile time?
Correct. And at compile time you can use a macro. Of course, that foo/bar
must then be available during compilation in .clj
or .cljc
.
but var based programming is severly limited due not CLJS not actually having reified vars in the runtime
If you do resolve
within a macro and you would like to resolve a CLJ var and not a CLJS var, then yes, it would be a regular resolve
.
My objective is to determine that the spec ::enum
in the below form is pointing to a symbol that resolves to a set literal. e.g., I call (s/form ::enum)
which yields user/enum-set
. I now would like to determine if that symbol is a set literal or not.
(def enum-set #{:a :b})
(s/def ::enum enum-set)
@U083D6HK9 kind of a pain but I've moved to using implements?
and protocols to accomplish similar tasks. was an enormous overhaul.
the issue is that the cljs.analyzer/compiler never actually evaluate any of the JS code they generate. so accessing things that are only "created" at runtime doesn't work. so in theory you can get the actual source string of the def
, but it'll be limited. what you really need to know is the value of the def, but that doesn't exist during compilation/macro expansion.
@U083D6HK9 I probably misread what you were saying as a broader discussion on strategies for data validation in clojurescript, so probably not on topic
Hi guys. How can I connect my ClojureScript project to Calva. I've tried using CTRL
+ ALT
+ C
, but it doesn't work in .cljs
files. it only works in .clj
files.
Is the project REPL running, or have you tried with letting Calva start it? This is the main doc page about connecting a project: https://calva.io/connect/
Yes the project's REPL is running on localhost:9500
I have tried to Let Calva start the server, and it successfully started it, but I was not able to evaluate expressions in my IDE using ALT
+ ENTER
.
Hmmm. Can you describe the steps you take when you try to connect the REPL? I do think that letting Calva start the REPL and Connect (aka Jack-in) is the first option we should try. So if you try that and describe the steps you take and what messages you get in the jack-in terminal, maybe we can figure out what goes wrong.
I pressed CTRL
+ SHIFT
+ P
then clicked on "start or connect to a Clojure repl
• I click "start your project with a repl and connect"
• I click "deps.edn + Figwheel main"
• I check :fig
and :build
• I click ok
This starts up the webpage at localhost:9500.
But I can't use the command in the ide to evaluate expressions.