This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-22
Channels
- # announcements (11)
- # architecture (7)
- # babashka (26)
- # beginners (314)
- # calva (20)
- # chlorine-clover (1)
- # cider (5)
- # circleci (27)
- # clara (6)
- # clj-kondo (41)
- # cljsrn (6)
- # clojure (120)
- # clojure-berlin (2)
- # clojure-czech (2)
- # clojure-dev (4)
- # clojure-europe (45)
- # clojure-france (4)
- # clojure-germany (1)
- # clojure-nl (5)
- # clojure-uk (20)
- # clojuredesign-podcast (8)
- # clojurescript (6)
- # conjure (42)
- # datascript (5)
- # datomic (21)
- # deps-new (28)
- # duct (1)
- # fulcro (36)
- # graalvm (10)
- # graphql (24)
- # jackdaw (19)
- # jobs (2)
- # jobs-discuss (46)
- # kaocha (6)
- # malli (26)
- # off-topic (21)
- # parinfer (5)
- # re-frame (10)
- # sci (19)
- # shadow-cljs (95)
- # tools-deps (24)
- # vim (3)
@borkdude: Looks like the tests have all passed on my PR: https://github.com/borkdude/sci/pull/424 I think this is roughly what you meant, but let me know if you want me to make any more changes
user=> (find-var '+)
Execution error (IllegalArgumentException) at user/eval1 (REPL:1).
Symbol must be namespace-qualified
Also:
user=> (find-var 'foo/bar)
Execution error (IllegalArgumentException) at user/eval143 (REPL:1).
No such namespace: foo
:thumbsup:
ahh amazing!
Hi it seems I can stop asking questions... Is there a Clojurescipt equivalent to:
(sci/binding [sci/out *out*]
(sci/eval-string "(println \"something\")"))
In other word can I bind something to make println
work when using sci from Clojurescript? Do I need to use console.log
?Very good question. I think xterm-sci is currently the best example, but I think it might be better for the future of sci started supporting *print-fn*
for CLJS.
https://github.com/babashka/xterm-sci/blob/main/src/xterm_sci/core.cljs
https://babashka.org/xterm-sci/
I'll take a look at the example thanks! I'll also the rebinding option, didn't think of that one!
If I get it right the sci internal 'clojure.core/println
is bound to cljs.core/println
that's neat. I'll try that!
@borkdude: I’ve updated: https://github.com/borkdude/sci/pull/424 With some error handling to mimic clojure’s behaviour, let me know if you require any further tweaks.
Excellent. Merged. Also updated bb master:
$ lein bb "(find-var 'clojure.string/join)"
#'clojure.string/join
[email protected] ~/Dropbox/dev/clojure/babashka (master) $ lein bb "(find-var 'clojure.string/joinz)"
[email protected] ~/Dropbox/dev/clojure/babashka (master) $ lein bb "(find-var 'clojure.stringx/joinz)"
----- Error --------------------------------------------------------------------
Type: java.lang.IllegalArgumentException
Message: No such namespace: clojure.stringx
Location: <expr>:1:1
----- Context ------------------------------------------------------------------
1: (find-var 'clojure.stringx/joinz)
^--- No such namespace: clojure.stringx
----- Stack trace --------------------------------------------------------------
user - <expr>:1:1
Error encountered performing task 'run' with profile(s): 'test'
Suppressed exit
[email protected] ~/Dropbox/dev/clojure/babashka (master) $ lein bb "(find-var 'clojure)"
----- Error --------------------------------------------------------------------
Type: java.lang.IllegalArgumentException
Message: Not a qualified symbol: clojure
Location: <expr>:1:1
----- Context ------------------------------------------------------------------
1: (find-var 'clojure)
^--- Not a qualified symbol: clojure
----- Stack trace --------------------------------------------------------------
user - <expr>:1:1
Error encountered performing task 'run' with profile(s): 'test'
Suppressed exit
Amazing, thank you!