3 Commits
Author SHA1 Message Date
Minus 7cdf388bf4 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.
2026-11-17 23:14:17 +00:00
Minus 6f6f444beb selectors: a.b sends with self, a::b without; drop a:b
The `.` and `::` selectors swap meaning and `a:b` is removed, so every
access is one of:

  a.b          read the member
  a.b(args)    call the member WITH a as self
  a::b         static read (no self)
  a::b(args)   call the member WITHOUT self

- compiler: postfix `.` emits CALLMETHOD (with self) when followed by
  `(`, else GETATTR; `::` emits GETATTR + CALL (no self); the `:` form
  is gone (with a helpful error suggesting `.`/`::`).
- `:` remains only for type hints (local x : int), unchanged.
- ffi: `lib.func(...)` (with self) and `ffi::load(...)` (no self); the
  native loaders no longer skip a receiver.
- file: `File::open` is static, so cm_open reads args[0]/args[1].
- lexer: fix cat_lexer_kind_name, whose table had drifted from the enum
  (missing `nil`), mislabelling tokens.
- self-hosted parser (std/lang/parser.cat): `.name(` -> method (self),
  `::name(` -> call (no self); compiler/checker unchanged.
- tools/migrate_selectors.py: one-pass migration of the call forms.
- regenerated std/glfw and std/vulkan; migrated examples/tests/std and
  the README; new tests/selectors.cat (130 green).

Verified live: GLFW window + Vulkan device still work; `a:b` now errors.
2026-11-17 18:55:18 +00:00
Minus e0bf102f2a functions are objects: closures carry a member table (_doc_)
- CAT_TYPES_FUNCTION_Closure gains an attrs table; get/set_attribute
  give closures real members, so a function can hold _doc_ and any other
  attribute like a table
- cat_types_function_attrs() accessor; attributes() enumerates a
  closure's members; help() reads a function's _doc_
- compiler: generalise dotted assignment to chains (name.a.b = v), so a
  method can be documented (Calc.add._doc_ = ...)
- tests/functions_as_objects.cat + 7 assertions (84 total, all green)
- README: 'funcoes tambem sao objetos' + reflection sections
2026-11-16 03:50:54 +00:00