This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-17
Channels
- # announcements (1)
- # aws (7)
- # babashka (5)
- # calva (56)
- # cider (13)
- # clj-commons (1)
- # clj-kondo (12)
- # clj-yaml (35)
- # clojure (84)
- # clojure-europe (93)
- # clojure-sg (2)
- # clojure-uk (1)
- # clojurescript (10)
- # conjure (37)
- # core-typed (1)
- # cursive (31)
- # duct (1)
- # figwheel-main (4)
- # fulcro (2)
- # holy-lambda (2)
- # humbleui (3)
- # membrane (118)
- # off-topic (46)
- # pathom (8)
- # podcasts-discuss (5)
- # releases (2)
- # rewrite-clj (13)
- # sci (27)
- # shadow-cljs (17)
- # tools-deps (12)
Quick question about sci.core/ns
. If I eval an expression that changes the namespace, such as (ns foo)
, should that information be available in sci.core/ns
? Given what I'm seeing for the https://github.com/babashka/babashka.nrepl/blob/master/src/babashka/nrepl/impl/server.clj#L121, I would expect so but in cljs I can't seem to get it working :thinking_face:
Yes but with eval-string ns is reset to the original binding, similar to load-string in Clojure
The sci.async ns has an eval-string+ function which returns the last ns binding as well. Sci/parse-next + eval-form allows you to save the last ns binding in case you are at the end of the stream
If you want sync eval, then use parse-next + eval-form. We could introduce a sci.core/eval-string+ as well
but I'm curious to learn what you are doing, it sounds like it's something I haven't explored
Interesting :thinking_face: I went the piggieback/shadow-cljs route and implemented nrepl middleware that intercepts evals 😆
Yeah, I'm not a big fan of middleware but I did get something working. Might try https://github.com/babashka/sci.nrepl instead.