lumo

:lumo: Standalone ClojureScript environment. Currently at version 1.9.0
grav 2019-11-01T06:51:18.027400Z

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

grav 2019-11-01T06:52:13.027600Z

@sogaiu ^

2019-11-01T06:53:17.028200Z

@grav thanks for the data point! i heard this doesn't occur for shadow-cljs.

grav 2019-11-01T06:54:11.029300Z

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=> 

2019-11-01T06:56:28.030900Z

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))

2019-11-01T06:57:38.032100Z

thanks for the info on what cursive uses -- does cursive work with self-hosted repls? i haven't tried.

grav 2019-11-01T06:59:38.033600Z

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.

grav 2019-11-01T06:59:56.034300Z

I think Cursive will soon support socket repls directly though. Maybe already does 🙂

2019-11-01T07:00:03.034500Z

yes, i've heard of tubular -- cool that those can be connected.

2019-11-01T07:00:14.034800Z

thanks for the tips 🙂

2019-11-01T07:00:21.035100Z

gotta go to sleep now

grav 2019-11-01T07:00:39.035400Z

🙂 Np - sleep tight! 🙂

2019-11-01T07:00:45.035600Z

take care!