From 20f4ac79b24fb3561d60105f233fe249f8dbf5fd Mon Sep 17 00:00:00 2001 From: Gianni Ceccarelli Date: Thu, 20 Jul 2023 15:36:59 +0100 Subject: notes for next steps --- meta-stuff.rst.txt | 50 +++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/meta-stuff.rst.txt b/meta-stuff.rst.txt index df8061e..96c33a9 100644 --- a/meta-stuff.rst.txt +++ b/meta-stuff.rst.txt @@ -1,14 +1,42 @@ -class ``Foo`` has class-level storage vars ``bos_class__Foo__$thing`` +next bits… -* ``bos_class__${class}__isa`` -* ``bos_class__${class}__meta`` +* fix all the ``*-into`` functions/methods to take the destination + variable name as 1st argument (otherwise optional arguments become a + mess) -``invoke $class $id $method @etc`` if ``$class/$method`` is defined, -call it; otherwise delegate to the meta-class -``bos_class__${class}__meta`` by calling ``$metaclass/invoke $class -$id $method @etc`` +* expose namespace open/close, and ``namespace $name; do …; done`` -then we have ``bos/mop/base/invoke`` and -``bos/mop/base/find-method-into`` and -``bos_class__bos__mop__base__meta="bos-dispatch/invoke bos/mop/base 0"`` -so its metaclass instance is an instance of itself + - use them inside ``class_open`` / ``class_close`` + +* formalise that ``bos-dispatch/invoke $class 0 $method $args`` is a + class method invocation + +* ``bos/mop/base`` + ``bos/mop/inheritance`` become ``bos/meta/class`` + +* add ``bos/meta/attribute`` + + - store values in ``bos-namespaces/store-*-for-into attribute + $attrname $defining_class $object_class $object_id`` (notice, we + also need the class that owns the attribute, not just the class + that generated the object, because attributes are local to the + class, they're not inherited!) + + - ``get-value`` / ``set-value`` methods + - add name, type, owning metaclass as attributes to itself + +* add attribute support to ``bos/meta/class`` + + - ``find-attribute-into`` + - ``add-attribute`` + - add class, mro, as attributes to the metaclass + +* store class→metaclass association somewhere (global dictionary, + probably) + + - when creating a class, create a metaclass instance and store it + - the store must be pre-populated with metaclass instances for: + + + ``bos/mop/class`` → ``bos-dispatch/invoke bos/mop/class 1`` + + ``bos/mop/attribute`` → ``bos-dispatch/invoke bos/mop/class 2`` + + and those instances' attributes must be manually stored -- cgit v1.2.3