mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-17 02:13:54 +00:00
Estimated hours taken: 2 Branches: main, release The current implementation of of bimap.set/4 breaks if you try to set a Key-Value pair that have already been mapped to each other. library/bimap.m: Fix the implementation of bimap.set/4. tests/hard_coded/bimap_set_bug.m: tests/hard_coded/bimap_set_bug.exp: Add a test for the above bug.
25 lines
254 B
Plaintext
25 lines
254 B
Plaintext
Forward map is:
|
|
map([
|
|
hydrogen ->
|
|
h,
|
|
helium ->
|
|
he,
|
|
lithium ->
|
|
li,
|
|
beryllium ->
|
|
be,
|
|
sodium ->
|
|
na])
|
|
Reverse map is:
|
|
map([
|
|
h ->
|
|
hydrogen,
|
|
he ->
|
|
helium,
|
|
li ->
|
|
lithium,
|
|
be ->
|
|
beryllium,
|
|
na ->
|
|
sodium])
|