Skip to content

Add a way to use comparison primitives #132

@Ailrun

Description

@Ailrun

Is your feature request related to a problem? Please describe.
Currently, it is not possible to use comparison primitives easily. This issue is to discuss ways in which it would be nicer to use, implement, etc.

Describe the solution you'd like
In order to use comparison primitives, this language needs at least one of the following.

  • Primitive pattern matches
  • Integer2Boolean conversion
  • Primitive if primIf (which uses an integer as its condition)

For each of these, implementation of higher level if (n <? 3) then t else f changes a lot.

  • Primitive pattern matches
    The expression would be match n < 3 with 1 -> t; 0 -> f;.
  • Integer2Boolean conversion
    It would be match integer2Boolean (n < 3) with C{1;0} -> t; C{2;0} -> f;
  • Primitive if primIf
    It would be primIf (n < 3) t f

Metadata

Metadata

Assignees

Labels

discussionThis issue or pull request is under a discussionenhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions