meander

All things about https://github.com/noprompt/meander Need help and no one responded? Feel free to ping @U5K8NTHEZ
chucklehead 2021-01-13T03:47:55.169100Z

would appreciate any suggestions on simplifying or otherwise improving this rewrite, first time really trying to do anything with cata and memory variables: https://github.com/casselc/dmarc/blob/4ce96be48367381d8983b2082174213ebf848725/src/casselc/dmarc.clj#L30

jimmy 2021-01-13T04:59:12.169300Z

Overall things look pretty good. Are there any things you are running into trouble with? A couple things I’d change from my quick glance. 1. Instead of (m/app merge map1 (m/cata !record)) you can do {:my-keys :my-vals & (m/cata !record)} 2. Sprinkle in some (m/some). Meander doesn’t actually check that keys exist in maps by default.

(m/rewrite {:a 2}
  {:record _ :as !record}
  [!record ...])

;; => [{:a 2}]

(m/rewrite {:a 2}
  {:record (m/some) :as !record}
  [!record ...])
;; =>  nil
If there is anything that isn’t working how you expect, definitely let us know and we can help.

chucklehead 2021-01-13T05:21:43.169500Z

thanks, the merge was making my eye twitch a little:slightly_smiling_face: - as best I can tell it's working correctly at the moment, although it took longer than I care to admit to get to this point. I mostly wanted to make sure I wasn't overly complicating anything or doing something boneheaded (like you pointed out with some )

chucklehead 2021-01-13T06:13:10.169700Z

I think missing m/some may have been why I couldn't get the {:spf}pattern variants to work as memory variables instead of using cata when I tried previously.

chucklehead 2021-01-13T06:16:30.169900Z

Also adding some uncovered an issue where some providers are sending fields in a different order than the schema specifies and I was just silently ignoring some of the data, so thanks again.