meander

Richie 2021-09-15T17:44:00.069400Z

In https://github.com/noprompt/meander/blob/epsilon/doc/operator-overview.md#rest What’s happening in

(m/match #{1 2 3}
  #{^& ?rest}
  ?rest)
What is & contributing here? More importantly what’s ^ contributing here??

Ben Sless 2021-09-15T19:38:18.069700Z

I'm guessing it's a hack to be able to rest match a set, so it's attached as a tag

Ben Sless 2021-09-15T19:38:22.069900Z

because sets are unordered

2021-09-15T19:51:59.070100Z

(m/match #{1 2 3}
  #{1 ^& ?rest}
  ?rest)
;;=> #{2 3}

2021-09-15T19:53:30.070400Z

allows you to match the rest of the elements from the set

2021-09-15T19:54:35.070600Z

macro expands to cojure.set/difference

Richie 2021-09-15T23:34:27.081700Z

Woa, thanks. I didn’t think to macroexpand but I can actually read the code I get out of macroexpanding that example!

🙂 1