lesson 06 / 15
Objects
Objects group related values. The explicit object form is useful when the object has a clear name.
object system {
name: "Kreato Linux"
architecture: "x86_64"
}
main {
print "${system.name} runs on ${system.architecture}"
}Object properties can also be accessed with bracket notation, for example system["name"]. Dot notation inside ${...} is usually easier to read.
Objects are especially useful for project-provided context. An embedding project can expose information about the package, target architecture, or build root as one object instead of many unrelated variables.
