const
const, keyword, assignment option
The const
keyword indicates that the value taken by a variable is known at compile time and that it won’t change later at runtime. Those variables are primarily intended to control the files being read.
const myFolder = "/foo"
read "\{myFolder}/products.csv" as Products with
Product: text
Price: number
Notably, the read
block requires a text value for its file path that evaluates as const
.
const, keyword, pure function option
The const
keyword indicates that the pure function can be executed at compile time.
def const pure myInc(a: number) with
return a + 1
const x = myInc(42)
show scalar "" with x
In the present reference documentation, pure functions that are part of the Envision standard library and that can be executed at compile time are marked as const
.