[#123] Fix stack mutation in `MAP` primitive
Description
Problem: in our implementation `MAP` primitive discards all changes made
to stack elements deeper than the top one (which is set to current
iteration value). Incidentally this behavior was implemented with the
same error in Babylonnet. However in Carthagenet it was fixed and thus
our interpreter became non-conforming both to the spec and to the
reference implementation.
Solution: correctly keep track of stack changes in `MAP` implementation.
Related issue(s)
Resolves #123 (closed)
✅ Checklist for your Merge Request
Related changes (conditional)
-
Tests (see short guidelines)
-
If I added new functionality, I added tests covering it. -
If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
-
-
Documentation
Stylistic guide (mandatory)
-
My commits comply with the following policy. -
My code complies with the style guide.