Skip to content

switch macro evaluates the match value multiple times #54

@edsrzf

Description

@edsrzf

The switch macro evaluates the match value once for each case. This can cause duplicate side effects and strange errors if the switch value tries to bind variables.

For example:

(import std.Prelude)
(switch (let n 0)
  1 2
  3 4
)

This results in the error:

MutabilityError: Can not use 'let' to redefine variable `n'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions