Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
notes:decker_hacking [2024/04/15 13:34] – maff | notes:decker_hacking [2024/04/15 20:43] (current) – maff | ||
---|---|---|---|
Line 38: | Line 38: | ||
to turn a char* into a lil string: | to turn a char* into a lil string: | ||
+ | |||
lv *r = lmutf8(chrstr) | lv *r = lmutf8(chrstr) | ||
+ | |||
don't forget to free() the chrstr | don't forget to free() the chrstr | ||
Line 45: | Line 47: | ||
===== methods i don't understand the function of yet: ===== | ===== methods i don't understand the function of yet: ===== | ||
- | lis(lv*) | + | lis(lv*) lil(lv*) lmistr(lv*) lmnat(lv*, |
- | lil(lv*) | + | |
- | lmistr(lv*) | + | |
- | lmnat(lv*, | + | |
also what are x and i | also what are x and i | ||
+ | |||
+ | ===== API docs now that i understand it a bit better ===== | ||
+ | |||
+ | `lv` is a variable that's a struct. the actual `char *` is member `sv`. | ||
+ | |||
+ | When defining an interface with `ikey`, the second arg can be lmnat if it's supposed to call a function with arguments (a native method) or it can be just a function call that returns an lv* or it can be just an lv* itself, if it should be a member and not a method. | ||
+ | |||
+ | invoking a method via lmnat will cause the first arg to be lv *self and the second to be lv *a. i'm unsure what self is, but a is a list of arguments. | ||
+ | |||
+ | lmnat, lms and so on are all declared via the lm(str, int) macro | ||