This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-06-28
Channels
- # adventofcode (12)
- # announcements (1)
- # asami (18)
- # aws (1)
- # babashka (20)
- # beginners (80)
- # calva (11)
- # cider (10)
- # circleci (5)
- # cljsrn (2)
- # clojure (37)
- # clojure-australia (15)
- # clojure-europe (32)
- # clojure-nl (2)
- # clojure-uk (26)
- # clojured (7)
- # clojurescript (10)
- # clojurewerkz (3)
- # cursive (45)
- # data-science (12)
- # datomic (3)
- # emacs (8)
- # events (3)
- # fulcro (23)
- # graphql (5)
- # helix (3)
- # jobs (1)
- # jobs-discuss (1)
- # juxt (3)
- # lsp (12)
- # malli (4)
- # meander (4)
- # reagent (11)
- # releases (1)
- # shadow-cljs (28)
- # sql (35)
- # tools-deps (9)
- # xtdb (25)
Morning!
Godmorgen!
Good morning 😊
@jasonbell some regex pro tips: ... s/r/rn/
would do it ... no need for the /g
... yes I know, I'm the worst.
I must admit that I thought the same! Though I pretty much always put /g
by default, because I usually need it
(I didn’t think about the r/rn
bit)
If I have a function taking arguments [x y]
, how can I transform it to a function taking [y x]
? Same function body, I just want to call it with x
and y
reversed.
Negative and positive lookahead and lookbehind are awesome things
@pez This would only work for a 2 arg function but is more performant than when you would do it for n args using var-args and apply
(defn flip [f] (fn [x y] (f y x))
This would the the n-args version:
(defn reverse-args [f] (fn [& args] (apply f (reverse args))))
I think this function is called flip
in Haskell (so I edited the 2 args version with that name now)
@raymcdermott I’m fully aware but I do appreciate the reminder, I was covering past mistooks 😉
@jasonbell yeah I figured but thought a little regex frivolity might lighten Monday
Next :clojureD 2021 talk by @mkvlr now online: https://www.youtube.com/watch?v=Gnrh7XOt_84
I must admit that I thought the same! Though I pretty much always put /g
by default, because I usually need it
Negative and positive lookahead and lookbehind are awesome things