calcit
calcit copied to clipboard
new macro tag-match
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"