Skip to content

[#44] add definitions and generator of Indigo functions and procedures

Description

Functions for Indigo do not clear the stack from elements created inside their scope. Because of this managing them requires ad-hoc code that deals with the internals of Indigo's state.

Using the code-clearing feature added for #41 (closed) in !217 (merged) to GenCode we can define functions to generate an Indigo Function or Procedure (depending if what they return is to be kept or not, respectively). Type synonyms to help recognize such cases of IndigoM have also been added.

Note: the name of the generating functions suggests they are to be used during definition, because it seemed more appropriate than to leave the decision to the caller (even tho the code would have been the same and these could in fact be used in such fashion).

Related issue(s)

Resolves #44 (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 the changelog if my changes are externally visible.

Stylistic guide (mandatory)

Edited by Pinto Pasquale

Merge request reports