This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-16
Channels
- # announcements (7)
- # aws (9)
- # babashka (31)
- # beginners (28)
- # calva (14)
- # clj-kondo (29)
- # cljs-dev (23)
- # cljsrn (16)
- # clojure (21)
- # clojure-france (1)
- # clojure-nl (2)
- # clojure-spec (20)
- # clojure-sweden (4)
- # clojure-uk (6)
- # clojurescript (62)
- # community-development (5)
- # conjure (81)
- # cursive (14)
- # datomic (5)
- # defnpodcast (2)
- # docker (1)
- # figwheel-main (11)
- # fulcro (17)
- # graalvm (5)
- # jobs-discuss (5)
- # kaocha (1)
- # off-topic (54)
- # pathom (1)
- # pedestal (1)
- # quil (1)
- # re-frame (34)
- # shadow-cljs (34)
- # tools-deps (39)
- # uncomplicate (2)
Hello, guys! May you can help me... I'm trying to use Selmer to generate some XML files where I need to replace some variables... I have a XML template file and it working, except for this: Selmer is changing all tag names to lower-case... but I need to preserve the case. Do you know if thats is possible? How can I do?
@gleisonsilva Selmer doesn't change any of the template. It just substitutes the variables.
So if the tag names really are getting converted to lower case, it's something else...
Hello, @U04V70XH6! In fact, I'm not using Selmer directly, but via Bootleg... so maybe it's the point. I'll investigate more. Tks a lot for replying!
I don't understand this behavior, and you?
(= (update-in {:a 1} [] assoc :b 1)
{:a 1, nil {:b 1}})
could update-in be implemented this way?
(defn update-in
[m ks f & args]
(letfn [(up [m ks]
(if-not (seq ks)
(apply f m args)
(let [[k & ks] ks]
(assoc m k (up (get m k) ks)))))]
(up m ks)))
@pbaille https://clojure.atlassian.net/browse/CLJ-373 https://clojure.atlassian.net/browse/CLJ-1520
thank you for the links @leonel.gayard
(into [] (halt-when #{4}) (range 10))
=> Execution error (ClassCastException)
=> class java.lang.Long cannot be cast to class clojure.lang.ITransientCollection
I guess halt-when
is not supposed to be used in into
context as is (it has additional arity that can return an acc so far)
it works fine in transduce
though:
(transduce (halt-when #{4}) conj [] (range 10)) => 4
Clojurists, If you had this fn:
(fn [x] (map #(Integer. (str %)) (str (clojure.edn/read-string x))))
can you think of any 'Hard to even tell what the intent is, but I think it is trying to parse a string of digits as integers
read-string returning a number, the number turned into a string, then mapping a function which turns each character into a string, then parses each character as an integer
Yes, it’s a redundant function, I noticed that, I was trying to figure out if the function could receive something dangerous combining edn/read-string + Integer.
But there’s nothing to worry I think
The only real danger would be if there’s a Clojure.core/read-string
or eval
on a wrapper function or somewhere else