This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-03-13
Channels
- # announcements (14)
- # babashka (13)
- # beginners (25)
- # biff (7)
- # calva (36)
- # clj-kondo (22)
- # clojure (31)
- # clojure-austin (1)
- # clojure-europe (12)
- # clojure-losangeles (4)
- # clojure-nl (1)
- # clojure-norway (61)
- # clojure-uk (4)
- # clojurescript (3)
- # datomic (24)
- # events (1)
- # humbleui (9)
- # leiningen (9)
- # lsp (30)
- # malli (3)
- # missionary (15)
- # off-topic (5)
- # re-frame (4)
- # reitit (7)
- # releases (2)
- # remote-jobs (4)
- # rewrite-clj (11)
- # ring-swagger (2)
- # sci (6)
- # xtdb (2)
- # yamlscript (3)
When you create a namespace in a sci evaluation, all of the public symbols from clojure.core
are referred as it should be.
I've been merging vars into clojure.core
from another ns so they will also be "auto-referred".
But that's become problematic, and I'd like to specify that other ns as something to be additionally auto-referred.
How can I do that in my sci context init?
Thanks. "you can't" is actually very helpful here 🙂
hmmm. It's a bit tricky because I want to get at this var:
https://github.com/babashka/sci/blob/a39073922c10638f6a5afd0ade139d6bcde24535/src/sci/impl/namespaces.cljc#L1332
is there a simple way to do that?
Basically I'm trying to define my own eager version of for
that calls the for
in sci...
Given this in ys.ys
(defmacro for [bindings & body]
`(do
(doall (_for [~@bindings] (do ~@body)))
nil))
I'm trying this in my sci setup:
(sci/intern @ys/sci-ctx 'clojure.core '_for
(sci/resolve @ys/sci-ctx 'clojure.core/for))
(sci/intern @ys/sci-ctx 'clojure.core 'for
(sci/resolve @ys/sci-ctx 'ys.for/for))
but getting
Syntax error macroexpanding at (runtime.clj:108:1).
Execution error (ExceptionInfo) at sci.lang.Var/bindRoot (lang.cljc:112).
Built-in var #'clojure.core/for is read-only.
is there a way to pull this off?