-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expression Definition Statement
IsaacShelton edited this page Mar 21, 2022
·
1 revision
Commonly used expressions can be assigned a name via the define
keyword
define distance = sqrtf(x * x + y * y)
Since expression definitions just assign a name to an expression, they are re-evaluated each time they are used.
import basics
func main {
x int = 0
define next_x = ++x
repeat 3, print(next_x)
}
1
2
3
If this is behavior is undesired, you should use const
variable declarations instead.