object, not table: fix user-facing terminology
The language is OOP with a single compound value, the object (an
anonymous `{...}` or a class instance); it is not Lua and has no
"tables". The visible type name was already `object`; this fixes the
remaining user-facing wording:
- error messages: "object has no member 'x'", "object is not callable".
- README: drop the "Lua-like" phrasing; describe member objects, not
tables.
- self-hosted front-end AST node `t="object"` (was "table"), updated
across parser/compiler/checker.
- test comments/expected output aligned ("object:").
The internal C symbols keep the cat_types_table_* naming convention.
Suite stays 130 green.
This commit is contained in:
1 parent
a73600e221
commit
7cdf388bf4
10 files changed
+18
-18
No files matched your search
@@ -1,7 +1,7 @@
|
||||
-- tests/functions_as_objects.cat -- functions are objects too.
|
||||
--
|
||||
-- A closure carries a member table, so it can hold `_doc_` (and any
|
||||
-- other attribute) exactly like a table. `help()` reads it; a dotted
|
||||
-- A closure carries a member object, so it can hold `_doc_` (and any
|
||||
-- other attribute) exactly like an object. `help()` reads it; a dotted
|
||||
-- assignment can reach an attribute of a nested object (a method).
|
||||
|
||||
local t = {x = 1, y = 2}
|
||||
|
||||
Reference in new issue
Block a user