mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 17:33:38 +00:00
Estimated hours taken: 2 Branches: main Add the operation transform_value to map, tree234 and rbtree. This applies a higher order argument to a value in the map. Often a value needs to be updated using its previous value. Currently this requires two lookups of the key. With transform_value only one lookup is required. NEWS Mention the new predicate. library/map.m library/rbtree.m library/tree234.m Add transform_value. library/require.m Add a version of report_lookup_error that doesn't take a value argument, since the value argument is not available in transform_value. tests/hard_coded/Mmakefile tests/hard_coded/transform_value.exp tests/hard_coded/transform_value.m Test transform_value.
7 lines
92 B
Plaintext
7 lines
92 B
Plaintext
2
|
|
key not found
|
|
2
|
|
2
|
|
[1 - 2, 2 - 2, 3 - 2, 4 - 2, 5 - 2, 6 - 2, 7 - 2, 8 - 2]
|
|
[1 - 2, 2 - 2]
|