Skip to content

Instantly share code, notes, and snippets.

@mmower
Last active July 5, 2016 14:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmower/3cd21f55a80fa335b0fbd2defdf331a1 to your computer and use it in GitHub Desktop.
Save mmower/3cd21f55a80fa335b0fbd2defdf331a1 to your computer and use it in GitHub Desktop.
; Given a data structure like
[[:cv [...nested structure...] [:cvc [...nested structure...] [:vc [...nested structure...] ...]
; and a match rule like (suggestion, i'd be happy with anything that conveys the rule)
[:cvc :vc]
; and a transform like (ditto)
[:cvc "-" :vc]
; I want to end up with a structure
[[:cv [...] [:cvc [...]] "-" [:vc [...]] ...]
; i.e. I am looking to match part of the top-level of a nested structure and then
; transform that structure to insert items (but maybe later slightly more sophisticated
; operations), preserving the surrounding structure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment