clojure-nl

Companies working with Clojure in The Netherlands: https://docs.google.com/spreadsheets/d/1NzOqY1v-OReB1IquUgHuT3Kh8K8jhPdlwBM6ds7id6Y/edit?usp=sharing
borkdude 2021-01-17T15:10:03.018Z

Are you familiar with core.match? After the core.logic workshop on Wednesday, this looks oddly familiar:

$ ./bb -e "(require '[clojure.core.match :as m]) (m/match (range 100) ([_ _ _ _ & r] :seq) (first r))"
4

borkdude 2021-01-17T15:10:33.018200Z

$ ./bb -e "(require '[clojure.core.match :as m]) (m/match [0 1 2 3] [0 a 2 b] [a b])"
[1 3]

borkdude 2021-01-17T15:10:38.018400Z

^ @stefan.van.den.oord

Stefan 2021-01-17T15:13:28.020400Z

Well, I know it exists, but not much more than that :) Isn’t that the lib that also allows you to do more advanced pattern matching on fn arts, a la Haskell?

borkdude 2021-01-17T15:13:59.020900Z

it's basically a more sophisticated case but I don't think you can use it for defining functions

borkdude 2021-01-17T15:14:39.021600Z

but you can use it like this:

(defn foo [& args]
  (m/match args
    [0 1 a] a))

borkdude 2021-01-17T15:20:37.021800Z

Actually, like this:

(defn foo [& args]
  (m/match args
           ([0 1 a] :seq) a))

Stefan 2021-01-17T15:24:04.022500Z

Yes, very nice I think. Have you used it “in anger”?

borkdude 2021-01-17T15:25:03.023Z

No, I haven't. Just started experimenting with adding it to babashka (because it was requested here https://www.reddit.com/r/Clojure/comments/kyke06/please_vote_if_youre_interested_in_seeing/)

borkdude 2021-01-17T15:31:47.023300Z

@stefan.van.den.oord This appears to be a nice tutorial: https://blog.klipse.tech/clojure/2016/10/25/core-match.html

borkdude 2021-01-17T15:36:08.023700Z

Hmm, that site makes your fans spin though

Mno 2021-01-17T16:41:12.024200Z

oh boi, I always immediately assume crypto mining when my fans start spinning on a website

borkdude 2021-01-17T16:41:59.024400Z

That problem has now been fixed btw

borkdude 2021-01-17T16:42:03.024600Z

Quick reaction by the maintainer

Mno 2021-01-17T16:44:25.025100Z

Impressively quick