Skip to content

Commit e4503db

Browse files
committed
feat: Add stdlib_core to register standard library modules and global native functions.
1 parent 5f87e07 commit e4503db

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/stdlib/stdlib_core.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,9 @@ extern Value native_clock(int argCount, Value* args);
3232

3333
static Value native_len(int argCount, Value* args) {
3434
if (argCount < 1) return NUMBER_VAL(0);
35-
printf("native_len: Type=%d, IS_LIST=%d, IS_STRING=%d\n", AS_OBJ(args[0])->type, IS_LIST(args[0]), IS_STRING(args[0]));
3635
if (IS_STRING(args[0])) return NUMBER_VAL((double)AS_STRING(args[0])->length);
37-
if (IS_LIST(args[0])) {
38-
printf("It is a list! Count: %d\n", AS_LIST(args[0])->count);
39-
return NUMBER_VAL((double)AS_LIST(args[0])->count);
40-
}
41-
if (IS_MAP(args[0])) return NUMBER_VAL((double)AS_MAP(args[0])->count);
36+
if (IS_LIST(args[0])) return NUMBER_VAL((double)AS_LIST(args[0])->count);
37+
if (IS_DICTIONARY(args[0])) return NUMBER_VAL((double)AS_DICTIONARY(args[0])->items.count);
4238
return NUMBER_VAL(0);
4339
}
4440

0 commit comments

Comments
 (0)