Skip to content

[#123] Fix stack mutation in `MAP` primitive

Maxim Koltsov requested to merge maksbotan/#123-fix-stack-handling-in-MAP into master

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

    • I checked whether I should update the docs and did so if necessary:
    • I updated changelog files of all affected packages released to Hackage if my changes are externally visible.

Stylistic guide (mandatory)

Merge request reports