Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boolean Primitives are not semantically implemented #72

Open
CodyFagley opened this issue Jun 15, 2021 · 0 comments
Open

Boolean Primitives are not semantically implemented #72

CodyFagley opened this issue Jun 15, 2021 · 0 comments
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers

Comments

@CodyFagley
Copy link
Member

CodyFagley commented Jun 15, 2021

(See tests/Conditions/if.xs)

In the second if ... then ... else ... statement, False is only syntactically active right now.

When a boolean primitive (True & False), is encountered, a corresponding value should be pushed onto the active register stack. E.g. False should produce '0' and True should produce '1'. When a primitive is encountered, the minimum following changes need to occur:

  • LastType(TYPE_BOOLEAN) and LastConstructor(TYPE_BOOLEAN) is recorded in the context manager
  • LastData(x) is recorded in context manager, where x==1 or x==0 depending on True/False
  • LastExpression(EXP_LITERAL) is recorded in Context Manager

The active register stack seems to allocate a new register when boolean literals are encountered, so that shouldn't need any attention.

NOTE: This effect should also trigger when a constant or function is invoked (if it returns a boolean literal value).

@CodyFagley CodyFagley added bug Something isn't working enhancement New feature or request good first issue Good for newcomers labels Jun 15, 2021
@CodyFagley CodyFagley changed the title Boolean Primitives are not semantically-active Boolean Primitives are not semantically implemented Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant