-
Notifications
You must be signed in to change notification settings - Fork 0
Structs
Julius Paffrath edited this page Jun 27, 2026
·
4 revisions
A struct is a data type gathering around other variables, called fields:
struct Car
set name to ""
set hp to 0
endstruct
set bmw to Car(name = "BMW", hp = 120)
print("I am driving a " + bmw->name + " with " + bmw->hp + " HP!")
Structs are, like lists, immutable. In order to update a field, the struct has to be copied:
set bmw to bmw update name = "Mercedes" update hp = 218