Split overloaded if
construct into if
and when
for compiletime and runtime conditions
#3
Labels
good first issue
Good for newcomers
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, whilewhen
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 onif
with a non-constant.The rest of the syntax can be entirely shared!
The text was updated successfully, but these errors were encountered: