This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-25
Channels
- # announcements (1)
- # beginners (131)
- # cljs-dev (1)
- # clojure (178)
- # clojure-argentina (1)
- # clojure-dev (3)
- # clojure-uk (2)
- # clojuredesign-podcast (1)
- # clojurescript (16)
- # code-reviews (2)
- # core-async (2)
- # emacs (28)
- # figwheel-main (19)
- # fulcro (11)
- # kaocha (1)
- # leiningen (4)
- # music (6)
- # off-topic (2)
- # re-frame (2)
- # reitit (6)
- # rewrite-clj (9)
- # shadow-cljs (78)
- # slack-help (6)
Hi Guys, could anyone tell me please how can I use goog.string.Stiringifier
?
Logically speaking this should work (goog.string.stringifier/stringify #js {"a" "A"})
Stringifier is just an interface, the implementation is elsewhere https://github.com/google/closure-library/blob/master/closure/goog/string/stringifier.js
What does ^not-native
mean again? I have trouble finding docs on this (except for some blog posts that allude to something about protocols).
usually the compiler will emit a conditional call to a protocol that first checks if the protocol property exists. not-native tells the compiler to skip that check and blindly call the protocol
foo.some$protocol$prop ? foo.some$protocol$prop(...) : some.protocol.prop(foo)
something like that is normal and with not-native it'll call foo.some$protocol$prop(...)
directly without checks
is this expected?
ClojureScript 1.10.520
cljs.user=> (identical? ::eof ::eof)
false
cljs.user=>
Clojure 1.10.1
user=> (identical? ::eof ::eof)
true
user=>
hey guys, how do I dynamiclly require name spaces in the repl?
#?(:clj
(defmacro repl! ;;This works
[]
(require '[shared.repl :as rpl]
'[clojure.repl :as rl]
'[cognitect.rebl :as rbl]
'[clojure.reflect :as reflect]
'[clojure.java.javadoc :as jdoc])
(println "-- REPL LOADED --")
(println "The current namespace is : " *ns*))
:cljs
(defmacro repl! ;; no idea how to make it work in cljs
[]
`(something something)))
I got it working in clj, but not cljs
Im thinking that it has to be a macro
because when I include require
in a fn
it complains that require
must be in the top level