πŸ–ΌοΈConstants

You can only declare constants at the toplevel scope

Constant Declaration Syntax

[export] const <CONST_NAME_HERE> = <expr>

Working Example

package main

import "fmt" as fmt

const PI = 3.14
const MY_NAME = "Bob"

fun main(): Unit {
  fmt.println("My name is " + MY_NAME + ". And pi is approximately:")
  fmt.println(PI)
}

Last updated