π Scope Variables
There are two types of scope variable bindings in Gauntlet:
1. let-variables
let-variables use the :=
operator under the hood. It's syntax is:
let <varPattern> [: TypeName] = <expression>
2. zero-variables
Zero-variables create an instance of a type's "zero" value. In Gauntlet, the syntax is:
zero <varPattern>: <TypeName>
Working Example
package main
import "fmt" as fmt
fun main(): Unit {
let a, b, c: Int = (1, 2, 3)
let myName = "Bobby"
fmt.println(myName)
zero myZeroVar: Int
fmt.println("The number below should be 0, since it's Int's 'zero' value:")
fmt.println(myZeroVar)
}
Last updated