This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-03
Channels
- # announcements (15)
- # babashka (143)
- # babashka-sci-dev (2)
- # beginners (35)
- # biff (11)
- # calva (5)
- # cider (8)
- # clerk (4)
- # clj-kondo (58)
- # cljdoc (6)
- # clojure (88)
- # clojure-denmark (1)
- # clojure-europe (77)
- # clojure-nl (1)
- # clojure-norway (16)
- # clojure-uk (1)
- # clojurescript (19)
- # clr (32)
- # code-reviews (158)
- # datahike (5)
- # datomic (10)
- # deps-new (3)
- # fulcro (12)
- # graalvm (20)
- # honeysql (23)
- # hyperfiddle (32)
- # kaocha (17)
- # membrane (6)
- # observability (1)
- # other-languages (2)
- # pathom (5)
- # practicalli (12)
- # reagent (4)
- # reitit (7)
- # releases (1)
- # sci (25)
- # shadow-cljs (52)
hmm, running into a weird error with copy-ns
and looking for a sanity check…
I am trying to use sci/copy-ns
with a namespace containing a defprotocol
. Here’s the copy-ns:
(ns re-db.sci-config
(:require [sci.core :as sci]
[re-db.sci-test :as test]))
(sci/copy-ns re-db.sci-test (sci/create-ns 're-db.sci-test nil))
Here’s the ns being required:
(ns re-db.sci-test)
(defprotocol ITest
(x [y]))
the error I get is:
Syntax error compiling at (src/main/re_db/sci_config.cljc:5:1).
Unable to resolve symbol: x in this context
@mhuebert You can use :exclude
to suppress copying for some of those things, but issue welcome
not really that well, since defprotocol inside SCI works quite different than outside SCI. this library does support it by changing the host protocol to take into account the SCI protocol: https://github.com/phronmophobic/scify
but the copy-ns macro has some difficulties with metadata / arglists that is sometimes quoted or not quoted which is where the unresolved symbol comes from, likely
which SCI version are you using? there have been some improvements in this area over the last year
I don’t have much time atm, just trying to get maria v2 out the door. so I think I will try to do the most limited thing