Fork me on GitHub
#beginners
<
2017-07-19
>
joshkh14:07:16

how can i go about using the newest (non-stable?) version of clojurescript that includes the nodejs changes? it looks like the releases on github:clojure/clojurescript and clojars are only the stable ones (<= 1.9.671)

spinningtopsofdoom14:07:30

You checkout the ClojureScript project then run ./script/build (see here https://clojurescript.org/community/building). That will build ClojureScript and then put the jar in your local maven repo.

nathansmutz18:07:39

Any regex experts on? I'm trying to capture text between two specific patterns. I get problems where the second pattern is repeated. I've tried (re-find #"(?<=One).*(?=Three)" "One Two Three Three") hoping to get " Two ", but I get " Two Three " instead. Is there a better way to express "All text between some-pattern-1 and the first subsequent occurrence of some-pattern-2"?

seancorfield18:07:19

@nathansmutz Sounds like you need to make the .* non-greedy?

nathansmutz18:07:49

@seancorfield Thanks! That's just what I needed. Wow, the ? operator is super overloaded.

pitalig21:07:30

Hey guys, may you help me again? I need to apply functionA to all but the last element of a map, then, to the last I will apply functionB... Any tips?

noisesmith21:07:54

what is the “last element” in a map?

noisesmith21:07:03

are you aware that maps are not ordered?

noisesmith21:07:25

or are you talking about calling the map function?

pitalig22:07:44

Oh, I'm sorry, it is an arraymap

moogey22:07:13

@pitalig ?

(defn map-but-last [coll fn last-fn]
    (concat (map fn (butlast coll))
            (list (last-fn (last coll)))))

pitalig22:07:13

"butlast" is new for me! Perfect!