ludic/examples/modules/registry_extend.ludic
Orkuncakilkaya a5f52c4581 feat(lang): def REGISTRY from "file.lres" - a game fills an open registry from its own file
The entries are read and checked against the registry's record as a
registry ... from file is, errors at the resource file's line, and they
are defs of the module that wrote the line: the registry must be open to
it, and they take that module's place in the stable order. Reseed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 07:22:05 +03:00

12 lines
529 B
Text

# registry_extend.ludic — L8 + L9: a game fills a package's open registry from its own resource
# file with `def Recipes from "recipes.lres"`. The entries are checked against Recipe as the file
# is read, and they come after the package's own, in file order.
#
# Running it prints: 3 Rope Pine tea Splint 20
import "crafting"
program RegistryExtend {
def Recipes from "recipes.lres"
entry {
print(`{RC_COUNT} {Recipes[0].name} {Recipes[RC_TEA].name} {Recipes[2].name} {Recipes[recipes_find("splint")].minutes}`)
}
}