KrkBoundMethod Struct Reference
A function that has been attached to an object to serve as a method. More...
#include <object.h>
Inheritance diagram for KrkBoundMethod:
Public Member Functions | |
KrkBoundMethod * | krk_newBoundMethod (KrkValue receiver, KrkObj *method) |
Create a new bound method. More... | |
Data Fields | |
KrkValue | receiver |
Object to pass as implicit first argument. | |
KrkObj * | method |
Function to call. | |
Data Fields inherited from KrkObj | |
uint16_t | type |
Tag indicating core type. | |
uint16_t | flags |
General object flags, mostly related to garbage collection. | |
uint32_t | hash |
Cached hash value for table keys. | |
struct KrkObj * | next |
Invasive linked list of all objects in the VM. | |
Protected Attributes | |
KrkObj | obj |
Base. | |
Detailed Description
A function that has been attached to an object to serve as a method.
When a bound method is called, its receiver is implicitly extracted as the first argument. Bound methods are created whenever a method is retreived from the class of a value.
Member Function Documentation
◆ krk_newBoundMethod()
KrkBoundMethod * krk_newBoundMethod | ( | KrkValue | receiver, |
KrkObj * | method | ||
) |
The documentation for this struct was generated from the following file:
- src/kuroko/object.h