calcit icon indicating copy to clipboard operation
calcit copied to clipboard

new macro tag-match

Open tiye opened this issue 1 year ago • 0 comments

tag-match provides arms that matches :tag field in a HashMap and give it a new name:

tag-match data
  :a new-name-a
    str-spaced "|found branch of" :a "|with value" $ :sth-of-a new-name-a
  :b new-name-b
    str-spaced "|found branch of" :b "|with value" $ :sth-of-b new-name-b
  _ :other

data should match map? data with a field :tag, for example:

{}
  :tag :a
  :sth-of-a "|some data belongs to a"

tiye avatar Oct 22 '22 04:10 tiye