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

Split overloaded if construct into if and when for compiletime and runtime conditions #3

Open
VonTum opened this issue Aug 12, 2024 · 0 comments
Labels
good first issue Good for newcomers

Comments

@VonTum
Copy link
Collaborator

VonTum commented Aug 12, 2024

We should use an extra keyword when to distinguish runtime conditions from compiletime codegen conditions?

There's a semantic difference between them. if prevents a section of hardware from being generated, while when just adds runtime conditions to it.

The big benefits are clarity of intent on the programmer's part. Also the benefit is the compiler can warn the programmer when using a when with a compile time constant, or an error on if with a non-constant.

The rest of the syntax can be entirely shared!

@VonTum VonTum changed the title if and when for compiletime or runtime conditions Split overloaded if construct into if and when for compiletime and runtime conditions Aug 13, 2024
@VonTum VonTum added good first issue Good for newcomers and removed Good for starters labels Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant