Alek Ratzloff 0d04090a99 Implement vtables and method resolution
Types now can have vtable elements which are used by instances to bind
themselves to methods. When Op::GetAttr is executed, it calls a new
function, Obj::get_attr_lazy. This will search:

* attributes on the object
* vtable on the object's type
* vtable on the object's type's type,
* etc.

This searches up the type tree for a named value. If it exists as an
attribute, it will be returned immediately. If it exists in the type's
vtable, then it will be inserted as an attribute. If the vtable value is
a function, the object that it is being called on will be bound to that
method as the `self` parameter.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-09-23 20:59:00 -07:00
2024-09-16 14:07:53 -07:00
Description
No description provided
804 KiB
Languages
Rust 95.5%
Python 4.2%
Shell 0.3%