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

Mitigate runtime errors for inf values #86

Open
2 of 3 tasks
heinezen opened this issue Feb 13, 2021 · 1 comment
Open
2 of 3 tasks

Mitigate runtime errors for inf values #86

heinezen opened this issue Feb 13, 2021 · 1 comment
Labels
c++ involves C++ code improvement improves existing functionality specification involves the nyan language specification

Comments

@heinezen
Copy link
Member

heinezen commented Feb 13, 2021

We have thought about amending the nyan language spec to mitigate runtime errors:

  • If an optional(..) type member has the None value assigned, all relative operations (+=, *=, etc.) on the value will have the result None.
  • The inf value for the int/float types can only be assigned -> Relative operation using inf as the operand will be disallowed.
  • The special case inf *= 0 will cause a RuntimeError

From: https://matrix.to/#/!iPmyRMGnDgSMPGqgaX:matrix.org/$w2yaN1vNl21LMYIU-CMcu2nNJDGHoLr1l1OhJP-BtwI?via=matrix.org&via=sft.lol&via=stusta.de

@heinezen heinezen added c++ involves C++ code improvement improves existing functionality specification involves the nyan language specification labels Feb 15, 2021
@TheJJ
Copy link
Member

TheJJ commented Aug 20, 2021

Implemented in #87: When operating on an optional that currently is None, the member remains None.
Infinity exceptions remain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ involves C++ code improvement improves existing functionality specification involves the nyan language specification
Projects
None yet
Development

No branches or pull requests

2 participants