refactored cosmoV_set & cosmoV_get, renamed COSMO_TOBJ->COSMO_TREF

also changed print() to print raw primitives instead of generating a <string> needlessly. helped performance immensely in scripts like `examples/increment.cosmo`
This commit is contained in:
2021-02-07 14:32:39 -06:00
parent 0d344f65df
commit 78e21a0f28
8 changed files with 92 additions and 38 deletions

View File

@@ -130,7 +130,7 @@ typedef struct CObjUpval {
#define cosmoO_readCString(x) ((CObjString*)x)->str
static inline bool isObjType(CValue val, CObjType type) {
return IS_OBJ(val) && cosmoV_readRef(val)->type == type;
return IS_REF(val) && cosmoV_readRef(val)->type == type;
}
// just protects against macro expansion