Morning
👋
Good morning everybody!
Moring
s/Moring/Morning/g;
Good Morning Everyone! 😄
Morning!
Morning!
moarning
God morgen
👋 ☕
Morning!
Good morning 😊
Godmorgen!
morning, slowly recovering from a really bad cold.
morning
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 took it as the regexp was installed from now on.
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.
s/(?<=r)/n/
no need to replace the r
with another r
😁
@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)
flip
, TIL
@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 didn’t think about the r/rn
bit)