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

const Keyword #32

Open
4 tasks
H1ghBre4k3r opened this issue Feb 22, 2023 · 0 comments
Open
4 tasks

const Keyword #32

H1ghBre4k3r opened this issue Feb 22, 2023 · 0 comments
Labels
compiler Something related to the compiler enhancement New feature or request interpreter Interpreter related typechecker TypeChecker-related
Milestone

Comments

@H1ghBre4k3r
Copy link
Owner

H1ghBre4k3r commented Feb 22, 2023

For exporting/importing/defining constants, it would be nice to have a designated keyword const. Variables declared as const are not mutable (not even in the current scope) and are exported. They should be constants, i.e., they have to be a static literal (so no if-else or function call).

Condition of Satisfaction

  • const keyword exists and can be parsed
  • typechecker asserts immutability
  • constants get exported
  • non-primitive/-static values are rejected (we could actually achieve that in the grammar)
@H1ghBre4k3r H1ghBre4k3r added the enhancement New feature or request label Feb 22, 2023
@H1ghBre4k3r H1ghBre4k3r added this to the v0.2.0 milestone Feb 22, 2023
@H1ghBre4k3r H1ghBre4k3r added compiler Something related to the compiler typechecker TypeChecker-related interpreter Interpreter related labels Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler Something related to the compiler enhancement New feature or request interpreter Interpreter related typechecker TypeChecker-related
Projects
None yet
Development

No branches or pull requests

1 participant