meander

All things about https://github.com/noprompt/meander Need help and no one responded? Feel free to ping @U5K8NTHEZ
markaddleman 2021-06-13T00:15:54.015700Z

One common use case I have is editing an element within a sequence. Is there a reason something like the following isn't included in the meander API?

(m/defsyntax within [label element-pattern]
  `(m/seqable ~(symbol (str "!" label "-before"))
              ...
              ~element-pattern
              & ~(symbol (str "?" label "-after"))))

markaddleman 2021-06-13T00:16:11.016100Z

It allows me to write:

(m/rewrite [[1 2 3]]
  (within outer (within inner (m/and ?n 1)))
  (within outer (within inner (m/app inc ?n))))

markaddleman 2021-06-13T01:07:39.017100Z

That may have come across snarkily - NOT how I meant it. My real question is, is there some reason this approach isn't going to work in general?