A macro to manipulate datamaps while retaining context
Created originally on Bitbucket by wyrde (wyrde vintersörg)
macros like (find:) are great for pulling raw data from a datamap, but only show one side of the map--the names OR the values. Which makes sense since the output is an array of the matching information.
A macro which can use the values of a datamap while retaining the context of the values (the names), would be very useful. Essentially providing output as a datamap.
For example, a datamap: ("box one" . 0 , "box two" , 1 , "box thee" , 0 , "box four" , 0 , "box five" , 3 , "green" , 1 , "purple" , 3 , "blue" , 1)
Returning a map of all the names and values where values are greater than 1, or names and values which match "purple".
Currently, the method to show values in context is a for loop, essentially building a new datamap one matched value and its name at a time.