noprompt / meander

Tools for transparent data transformation
MIT License
921 stars 54 forks source link

Adds ability to use lvars as keys in maps in match. #64

Closed jimmyhmiller closed 5 years ago

jimmyhmiller commented 5 years ago

There are times when using an lvar as a key is perfectly acceptable. This allows those cases to work in maps. From everything I could think of or try I could not find one where this broke. There are I'm sure cases where this should be allowed but currently are not. But I think in most of those cases, meander wouldn't handle them properly as is.

matching is maybe not the greatest name and I'm happy to change it to something else. But I think this is an important property to know in matrix compilation. Match should never using any of our runtime functions. In this case by knowing that we were matching I was able to take something from a linear look up to a constant time lookup. This is a huge improvement and I think shows the need for having this during that step in the process.

I uncommented one test, I am happy to add more or make any suggested changes.

noprompt commented 5 years ago

@jimmyhmiller This looks pretty solid. Was there anything else you wanted to add to this?

jimmyhmiller commented 5 years ago

@noprompt If you like it, then it is good to go.