reflection: attributes() (dir-like) and help() with _doc_

- new list type (iterable, indexable) backing attributes()
- attributes(obj): member names of a table/object, follows __index
  inheritance, includes native and slot members (like Python dir())
- help(obj): prints the value's _doc_ documentation, else its type
  and attributes
- natives carry an optional _doc_ string (cat_types_native_new_doc);
  stdlib builtins documented
- len() handles lists
- examples/reflect.cat + 8 assertions wired into run_tests.sh (77 total)
This commit is contained in:
Minus committed 2026-11-16 03:48:44 +00:00
1 parent 4dae4ee1cd
commit 1203acd64b
8 files changed
+381 -14

No files matched your search

+1
View File
@@ -47,6 +47,7 @@ SRCS := \
src/cat/types/file.c \
src/cat/types/generator.c \
src/cat/types/selector.c \
src/cat/types/list.c \
src/cat/types/ffi.c \
src/cat/stdlib/stdlib.c \
src/cat/stdlib/toml.c \