Method resolution GitHub issue
vibecode
{"vibecode": { "doc": "object_method_resolution", "role": "spec for how a method call on an object resolves down its stack; the stack is an ordered array of platters and dispatch walks top to bottom (index 0 → end), consulting each platter that has a class; part of the universal object structure spec (see index.md)", "status": "active_design en route to settled spec", "audience": "Caspian implementers and security reviewers" }}
Calling a method on an object walks its stack looking for a class that defines the method. This page describes the walk, with a worked example.
A color object GitHub issue
vibecode
{"vibecode": { "section": "color_object_example", "role": "concrete example used by the method-dispatch walkthrough — a color object with its hex value in the bucket and a single class platter" }}
A color object:
json
{
"bucket": {"hex": "#abcdef"},
"stack": [
{"class": "https://puck.uno/color/"}
]
}
One field of data, one class platter. No shadow (nothing to put on one).
Method dispatch GitHub issue
vibecode
{"vibecode": { "section": "method_dispatch", "role": "describes how a method call resolves down the stack: walk the array top to bottom, consult each platter that has a class, first match wins, method-not-found raises" }}
Take the color object above and call red (which returns the decimal value of the red channel):
- Start at the top of the stack — the platter at index 0.
- Look at the platter's
class. If it definesred, dispatch lands there. - Otherwise, move to the next platter down (the next array element).
- Skip any platter that has no
classfield at all. Not every platter on the stack carries class identity — warning-only platters, nested-link platters, vibecode-only annotations, etc. The walk only consults platters that have a class. - Repeat until a class with a matching method is found.
- If the walk completes without a match, raise a method-not-found exception.
In the color example, the only platter has class: "https://puck.uno/color/", which defines red, so dispatch lands on it. The method returns 171 (decimal for 0xab).
Dispatch on a composite object GitHub issue
The walk works the same way on any stack, including one with a shadow, multiple class platters, and non-class platters interleaved:
json
{
"bucket": {"content": "Hello"},
"stack": [
{"shadow": true, "class": {}},
{"class": "https://foo.bar/gup/"},
{"warning": "content unverified"},
{"class": "https://puck.uno/upper"}
]
}
Calling shout on this object dispatches like so:
- Shadow at index 0 — class is
{}, no methods, walk moves on. https://foo.bar/gup/at index 1 — ifgupdefinesshout, dispatch lands here. If not, walk moves on.- Warning-only platter at index 2 — no
classfield; walk skips past. https://puck.uno/upperat index 3 — ifupperdefinesshout, dispatch lands here.- If neither class defined
shout, the walk completes and raises method-not-found.