registry NAME of RECORD [as PREFIX] is a global table; def NAME key { ... } in
any file is one entry, collected in source order and filled before any code
runs. Each entry gets an index constant (PREFIX_KEY), the table PREFIX_COUNT,
and a record with a key field gets it filled and a NAME_find(key). A record
literal naming a field its record lacks is now an error everywhere; a global's
initializer is lowered as its own file's code (its errors, and what its module
may see, were whichever statement came last).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
10 lines
216 B
Text
10 lines
216 B
Text
# L8: there is no registry Tables
|
|
program R {
|
|
property Furnishing {
|
|
key: string = ""
|
|
cost: int = 0
|
|
}
|
|
registry Furnishings of Furnishing
|
|
def Tables x { cost: 1 }
|
|
entry { print(FURNISHINGS_COUNT) }
|
|
}
|