☁️
DreamTode
  • Introduction
  • Types
  • Primitives
  • Arrays
  • Assignments
  • Objects
  • Parameters
  • Functions
  • Declarations
  • Templates
  • Instances
  • Custom Types
  • Dynamic Arrays
  • Ownership
  • It
  • Examples
Powered by GitBook
On this page
  • Overloading
  • Scoped

Was this helpful?

Declarations

The in-built let function lets you define constants in the current scope. It takes one array as an argument.

This defines name in the current scope:

let [name = "Lu"]

You might prefer to leave off the brackets:

let name = "Lu"

Overloading

You can define the same constant more than once.

let colour = "red"
let colour = 255, 70, 70

The most recently defined constant of the expected type gets used.

Scoped

let name = "Luke" in {
    print "Hello {name}!"
}
PreviousFunctionsNextTemplates

Last updated 2 years ago

Was this helpful?