Major refactoring, added classes, many bug fixes

This commit is contained in:
2020-11-09 19:44:12 -06:00
parent aa975b7330
commit c42a72dfad
21 changed files with 353 additions and 194 deletions

View File

@@ -9,13 +9,12 @@ void cosmoB_loadlibrary(CState *state) {
cosmoM_unfreezeGC(state);
}
int cosmoB_print(CState *state, int nargs, CValue *args) {
CValue cosmoB_print(CState *state, int nargs, CValue *args) {
for (int i = 0; i < nargs; i++) {
CObjString *str = cosmoV_toString(state, args[i]);
printf("%s", cosmoO_readCString(str));
}
printf("\n");
return 0; // print doesn't return any args
return cosmoV_newNil(); // print doesn't return any args
}