toaststunt
toaststunt copied to clipboard
Add support for addition/subtraction of Map data types
This adds the functionality for adding two maps together and for subtracting one map from another. In the case of addition, the key/value pairs from the right map are added to the map on the left. Thus, if there is a key collision, the key/value pair on the right side of the addition operation will be in the resulting map, rather than the left hand side. In the case of subtraction, the keys from the map on the right hand side, are removed from the map on the left hand side. A copy of the left hand side map is returned, minus the removed keys. Any keys that do not exist will simply be ignored. Using the subtraction operation, you could easily find key intersections between two maps. The error messages are also updated to reflect that maps can be used in +/- operations.