This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-01-15
Channels
- # adventofcode (2)
- # announcements (11)
- # babashka (48)
- # beginners (332)
- # calva (73)
- # cider (2)
- # clj-kondo (11)
- # cljfx (15)
- # clojure (23)
- # clojure-austin (1)
- # clojure-europe (42)
- # clojure-france (3)
- # clojure-nl (5)
- # clojure-taiwan (1)
- # clojure-uk (44)
- # clojurescript (25)
- # conjure (30)
- # cursive (3)
- # data-science (1)
- # fulcro (12)
- # jobs (3)
- # kaocha (1)
- # malli (2)
- # off-topic (49)
- # pathom (21)
- # pedestal (13)
- # re-frame (3)
- # reitit (1)
- # remote-jobs (1)
- # shadow-cljs (3)
- # sql (11)
- # startup-in-a-month (4)
- # tools-deps (113)
- # xtdb (16)
- # yada (6)
Is there a way to detect in a macro whether the current compilation is advanced or not?
@theller In CLJS I could rely on goog.DEBUG
but here it is about a macro behaving differently if it is being used in the context of an advanced build
:advanced
is technically not part of the CLJS compilation and only done on the final JS as a separate step
the idea was that you can look at the compiler options via the cljs.env/*compiler*
atom
shadow-cljs sets something in &env
which you can check easily
(defmacro foo [bar]
(if (= :release (:shadow.build/mode &env))
`(release-code)
`(dev-code)))
@thheller Excellent, both solutions are valid (checking &env
and using cljs.env/*compiler
)*
I'll use cljs.env
as it is more general, thanks
Hi! I am stumped with a n00b question. I want to add functionality to a React Native component. I am using the PEZ repo as my starting point and need to make a TextInput component have the .focus()
method called when the custom prop :focus
is true. I am using React Native, Expo, Re-frame and Reagent. I am completely at a loss as to how to get my own text-input
component from an existing React Native TextInput component. Thanks in advance for any guidance you can give me!
Hi, guys,
I'm trying to extend a type with a protocol and I'm having problem to find out which type to use.
When I run (type my-obj)
I get #object[LocalDate]
is this the right way?
Hi there,
I am new to Clojure
I needed help converting js function to clojurescript .
I have data coming from the API which is in PascalCased map key
I am trying to get to readable state ex InventoryListNo ---> Inventory List No
Since I am used to use to js this is what I have
function splitCamelCaseToString(s) {
return s.split(/(?=[A-Z])/).join(' ');
}
splitCamelCaseToString("HelloWorld")
output: "Hello World"
This is what I created in CLJS
(defn splitCamelCaseToString [s]
(->> (str/split s #"(?=[A-Z])")
(str/join s)))
output: HelloHelloWorldWorld
Someone please tell me what am I doing wrongYou used s
twice - you're joining ["Hello" "World"]
using "HelloWorld"
as a separator.
@singhamritpal49 This is the literal translation