-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expression Definitions
IsaacShelton edited this page Mar 21, 2022
·
1 revision
Expressions can be given a name using the define
define PI = 3.14159265
TAU :: define = 6.2831853
ROOT2 == 1.4142135
Since expressions definitions just attach a name to an expression, the expression is reevaluated in context each time it's used.
import basics
define COUNTER = getNextCount()
func main {
print(COUNTER)
print(COUNTER)
print(COUNTER)
}
func getNextCount() int {
static counter int = 0
return counter++
}
0
1
2