This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-01
Channels
- # announcements (7)
- # babashka (41)
- # beginners (117)
- # cider (3)
- # clj-kondo (145)
- # cljdoc (25)
- # cljs-dev (19)
- # clojure (197)
- # clojure-dev (14)
- # clojure-europe (4)
- # clojure-italy (3)
- # clojure-nl (2)
- # clojure-spec (11)
- # clojure-uk (21)
- # clojuredesign-podcast (5)
- # clojurescript (29)
- # code-reviews (4)
- # cursive (87)
- # data-science (11)
- # datomic (29)
- # duct (2)
- # emacs (10)
- # graalvm (1)
- # lumo (13)
- # malli (2)
- # nrepl (5)
- # off-topic (25)
- # onyx (1)
- # pathom (6)
- # reagent (20)
- # reitit (4)
- # rewrite-clj (7)
- # shadow-cljs (114)
- # spacemacs (16)
Interesting. No warning in Clojure. But same happens with Planck:
$ planck
ClojureScript 1.10.520
cljs.user=> (ns foo.bar (:require [clojure.string :as str]))
nil
foo.bar=> str/upper-case
#object[Function]
foo.bar=> (ns foo.bar)
nil
foo.bar=> str/upper-case
^
WARNING: No such namespace: str, could not locate str.cljs, str.cljc, or JavaScript source providing "str" at line 1
WARNING: Use of undeclared Var str/upper-case at line 1
Execution error (ReferenceError) at (<cljs repl>:1).
Can't find variable: str
Okay ... maybe it's something with self-hosted?
Anyway, I'm normally using in-ns
for these things (this is what Cursive also uses). Eg:
cljs.user=> (ns foo.bar (:require [clojure.string :as str]))
nil
foo.bar=> (ns baz.buz)
nil
baz.buz=> (in-ns 'foo.bar)
foo.bar=> str/upper-case
#object[Function]
foo.bar=>
the background is that at #chlorine we're working on trying to figure out stuff we can send to a variety of repls -- the following was working for non-clojurescript repls:
(if (find-ns 'foo.bar) (in-ns 'foo.bar) (ns foo.bar))
thanks for the info on what cursive uses -- does cursive work with self-hosted repls? i haven't tried.
I have used it together with lumo actually. Lumo exposes a socket repl, and when I used Cursive, it didn't support it directly. But then I launched (via Cursive) a clojrue program that used Mike Fikes' socket repl client https://github.com/mfikes/tubular for connecting.