Functions which operate on classes.
word_t croc_class_new | ( | CrocThread * | t, |
const char * | name, | ||
uword_t | numBases | ||
) |
Creates and pushes a new class named name
, using the top numBases
classes as its bases.
The bases (if any) are popped before the new class is pushed.
void croc_class_addField | ( | CrocThread * | t, |
word_t | cls, | ||
const char * | name | ||
) |
Adds a field named name
to the unfrozen class at cls
, assigning it the value on top of the stack and popping that value.
void croc_class_addFieldStk | ( | CrocThread * | t, |
word_t | cls | ||
) |
Same as croc_class_addField, but expects the name as a string on the stack below the value (like how croc_fielda works).
Pops both.
void croc_class_addMethod | ( | CrocThread * | t, |
word_t | cls, | ||
const char * | name | ||
) |
Adds a method named name
to the unfrozen class at cls
, assigning it the value on top of the stack and popping that value.
The value can be any type, not just functions.
void croc_class_addMethodStk | ( | CrocThread * | t, |
word_t | cls | ||
) |
Same as croc_class_addMethod, but expects the name as a string on the stack below the value (like how croc_fielda works).
Pops both.
void croc_class_addFieldO | ( | CrocThread * | t, |
word_t | cls, | ||
const char * | name | ||
) |
Same as croc_class_addField, but overrides any existing field (like the 'override' keyword in Croc).
void croc_class_addFieldOStk | ( | CrocThread * | t, |
word_t | cls | ||
) |
Same as croc_class_addFieldStk, but overrides any existing field (like the 'override' keyword in Croc).
void croc_class_addMethodO | ( | CrocThread * | t, |
word_t | cls, | ||
const char * | name | ||
) |
Same as croc_class_addMethod, but overrides any existing field (like the 'override' keyword in Croc).
void croc_class_addMethodOStk | ( | CrocThread * | t, |
word_t | cls | ||
) |
Same as croc_class_addMethodStk, but overrides any existing field (like the 'override' keyword in Croc).
void croc_class_removeMember | ( | CrocThread * | t, |
word_t | cls, | ||
const char * | name | ||
) |
Removes the member (field or method) named name
from the unfrozen class at cls
.
void croc_class_removeMemberStk | ( | CrocThread * | t, |
word_t | cls | ||
) |
Same as croc_class_removeMember, but expects the member name as a string on top of the stack, and pops the name.
void croc_class_addHField | ( | CrocThread * | t, |
word_t | cls, | ||
const char * | name | ||
) |
Same as croc_class_addField, but adds a hidden field instead.
void croc_class_addHFieldStk | ( | CrocThread * | t, |
word_t | cls | ||
) |
Same as croc_class_addFieldStk, but adds a hidden field instead.
void croc_class_removeHField | ( | CrocThread * | t, |
word_t | cls, | ||
const char * | name | ||
) |
Same as croc_class_removeMember, but removes a hidden field instead.
void croc_class_removeHFieldStk | ( | CrocThread * | t, |
word_t | cls | ||
) |
Same as croc_class_removeMemberStk, but removes a hidden field instead.
void croc_class_freeze | ( | CrocThread * | t, |
word_t | cls | ||
) |
Forcefully freezes the class at cls
, or does nothing if it's already frozen.
int croc_class_isFrozen | ( | CrocThread * | t, |
word_t | cls | ||
) |
cls
is frozen.