defining, assigning, and accessing data

Core language statements for creating bindings, mutating values, and declaring kinds/enums.

Overview

The core statement forms are:

  • Variable define (:=) to create a binding.

  • Variable assign (=) to update an existing mutable binding.

  • Operator-assign (+=, -=, *=, /=) for in-place arithmetic updates.

  • Tuple destructure ((a,b,...) := expr) to unpack tuple values.

  • Enum define ( := ...) to declare tagged variants.

  • Kind define ( := ) to declare named kinds.

Variable define (:=)

x:=10label:="hello"

Use ~ to define a mutable binding:

~counter:=0

Variable assign (=)

Assignment updates an existing mutable symbol:

~counter:=0 counter = counter+1

Assignment also supports indexed/sliced targets:

~m:=[
1 3
2 4
]
m[1,2] = 99

Operator-assign

In-place arithmetic statement forms:

~x:=5x+=2x*=3

Currently implemented operators are +=, -=, *=, /= in interpreter statement execution.

The grammar includes ^= (exp-assign-operator), but interpreter statement dispatch currently only implements add/sub/mul/div branches.

Tuple destructuring

Unpack tuple elements into new bindings:

(a, b, c):=(1,2,3)

Enum define ( := variants)

Declare enum variants using atom-style names, optionally with payload kinds.

<response>:=:ok<u64>|:error<string>|:timeout

Payload style variants are also valid:

<event>:=:click|:keypress<string>

Kind define ( := )

Declare a named kind alias/specification:

<distance>:=<f64>

Accessing values

Core access patterns include:

  • Identifier access: x

  • Index/slice access: m[1,2], xs[2]

  • Field/column access: record.field, table.column

For detailed indexing behavior, see indexing.

Notes

  • Use := to declare and = to update.

  • Assigning to undefined or immutable symbols is an error.

  • Mutation requires bindings declared with ~.