Issue #97 new

A macro to manipulate datamaps while retaining context

wyrde vintersörg
created an issue

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.

Comments (1)

  1. Leon Arnott repo owner

    The macro designed for working with names and values is (dataentries: ). However, you're right that there isn't currently an easy means of turning (dataentries:) arrays back into datamaps.

  2. Log in to comment