clojure-europe

For people in Europe... or elsewhere... UGT https://indieweb.org/Universal_Greeting_Time
dharrigan 2021-01-29T06:09:44.182Z

Buongiorno!

2021-01-29T07:02:12.182300Z

Morning

djm 2021-01-29T07:07:54.182500Z

👋

ordnungswidrig 2021-01-29T07:27:45.182700Z

Good morning!

thomas 2021-01-29T08:16:34.182900Z

moin moin

javahippie 2021-01-29T08:19:21.183200Z

G’moie!

slipset 2021-01-29T08:29:33.183400Z

Morning

2021-01-29T08:30:00.183600Z

Morning

orestis 2021-01-29T08:44:49.183800Z

Morning!

borkdude 2021-01-29T08:53:41.184Z

morning

ordnungswidrig 2021-01-29T09:17:24.184600Z

All snow is gone. Does anybody have an idea what this green stuff is? :thinking_face:😂

2021-01-29T09:45:27.185300Z

Astroturf if you are in the Houston Astros stadium, but asterturf everywhere else

RAMart 2021-01-29T09:49:21.185500Z

Your snow is just moldy.

🎯 1
pez 2021-01-29T10:23:24.185900Z

What green stuff?

slipset 2021-01-29T10:37:19.186900Z

minus 15 outside Oslo this morning.

🤘 2
2021-01-29T11:07:33.187500Z

:>>

1
slipset 2021-01-29T11:11:14.187800Z

what’s the :>> thingy?

2021-01-29T11:11:41.188Z

test-expr :>> result-fn
 Note :>> is an ordinary keyword

2021-01-29T11:11:56.188500Z

puts the result of the predicate into the function on the RHS

slipset 2021-01-29T11:12:56.189200Z

TIL

borkdude 2021-01-29T11:13:41.189800Z

I wish cond-> has this since I sometimes need the condition in the result (which gives rise to things like better-cond or else-thread https://gist.github.com/borkdude/93efc3f5978a2ed545553a47caaf7aa8)

borkdude 2021-01-29T11:14:11.190100Z

but you can also pull it out into a let I guess

2021-01-29T11:19:00.191800Z

what is cool about things like better-cond etc is that it can be done easily, what is bad is that you can end up with conflicting small dependencies if you don't copypasta code like that

slipset 2021-01-29T11:19:11.192100Z

It raises a, to me, interesting question, which is how much of a dsl you should add into a “feature”. Like, the common-lisp format and loop constructs are almost languages in them selves.

slipset 2021-01-29T11:20:06.193700Z

I guess it depends on how often you use a thing. The dsl that is destructuring is ok, because I use it all the time, the :>> thingy is something I’d likely not use, and if I did, it would confuse my cowworkers.

dharrigan 2021-01-29T11:20:08.194Z

Perhaps there should be a poll across the community to discover small 3rd party extensions like better-cond, vote on them and promote them into the core library?

slipset 2021-01-29T11:20:19.194400Z

I guess it boils down to “clever” code.

dharrigan 2021-01-29T11:20:39.194900Z

that would remove dependencies and encourage small, reasoned growth of the core library.

borkdude 2021-01-29T11:21:15.195100Z

(require '[clojure.core.match :refer [match]])

(defn regex [x]
  (re-matches #"(\w+)->(\w+)" x))

(match "foo->bar"
       ([_ x y] :<< regex) [x y]
       :else [])

borkdude 2021-01-29T11:21:30.195500Z

;;=> ["foo" "bar"]

borkdude 2021-01-29T11:22:34.195600Z

See this gist: https://gist.github.com/borkdude/93efc3f5978a2ed545553a47caaf7aa8 I think this covers most of these weird macro combinations, and the macro is super simple

val_waeselynck 2021-01-29T11:43:02.196Z

Morning

2021-01-29T13:17:31.196700Z

got some good help on a transducer question on #beginners https://clojurians.slack.com/archives/C053AK3F9/p1611850109057600

😺 1
2021-01-29T13:17:41.197100Z

I didn't know that identity is a transducer on its own

💡 4