diff --git a/src/interface.c b/src/interface.c index a6da43f..f3b1de8 100644 --- a/src/interface.c +++ b/src/interface.c @@ -193,6 +193,14 @@ GroundValue groundRunFunction(GroundFunction* function, size_t argc, ...) { // Seems to crash some functions // GroundScope callScope = copyGroundScope(&function->closure); + if (function->isNative) { + List argsList = createList(); + for (size_t i = 0; i < argc; i++) { + appendToList(&argsList, va_arg(args, GroundValue)); + } + return function->nativeFn(NULL, argsList); + } + GroundScope callScope = { .labels = malloc(sizeof(GroundLabel*)), .variables = malloc(sizeof(GroundVariable*)),