aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2025-09-24 01:17:24 +0000
committerrtk0c <[email protected]>2025-10-15 20:28:15 +0000
commitc4564f9f5c28abe8913c569374a7d778a6473210 (patch)
tree2e1754f07b86905cc57e7cb76d33a0148d084960
parent55f190a4ba6a6753228e1a59587c8402b390fd63 (diff)
Clarify terminology: decl and type; clarify helpers' usage
-rw-r--r--cm/ex01.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/cm/ex01.lua b/cm/ex01.lua
index 636ea2a..f92ec2a 100644
--- a/cm/ex01.lua
+++ b/cm/ex01.lua
@@ -1,6 +1,13 @@
-- Environment is loaded with the utils (as metatable.__index)
-- Global vars (aka properties on env) will be read as decls
+-- TERMINOLOGY:
+-- decl: a property somewhere, the property name and the value makes up the declaration
+-- type: a value (perhaps a part of a decl), which contains a type tag ("struct", "union", "alias", etc.) and extra info for that kind of type
+
+-- _struct, _union, _alias, etc. are type construction helpers.
+-- They take the essential info, and returns a value properly decorated. For example it might just add a property {_tag="struct"}, or perhaps more.
+
-- name implied by property key here
Bar = _struct({
-- _t: Loads another type by its name. Return the type, or a placeholder if the type is not yet available