language · language ·
Things: plain value data
thing defines plain value-shaped data. It is Yeho's default way to name a bundle of related fields.
Start with thing for coordinates, settings, records, messages, and other data that should behave like a value.
thing Name { Type field }
Name value = Name(arguments...)Status: stable
Plain data memory address
Start with thing for coordinates, settings, records, messages, and other data that should behave like a value.
cpu · complete-program · type checked
thing point
{
int x
int y
}
SetBoth(point memoryAddress target, int x, int y)
{
target.x = x
target.y = y
}
point value = point()
SetBoth(value, 8, 13)
if value.x == 8 and value.y == 13
{
Console.Log("plain-data-memory-address-ok")
}
project.mech
package = "tests.compiler.kyber.plainDataMemoryAddress"
version = "0.1.0"
backend = "kyber"
osTarget = "windows"
archTarget = "x64"
selfContainedApp = false
Notes and source
thing is preferred over the deprecated dobox alias.
Things can contain other things, which is how larger data maps stay understandable.
yeho/docs/language/language-core.md §3.1; tests/compiler/kyber/thing-runtime/start.yh