diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2022-01-01 19:42:10 +0100 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2022-01-01 19:42:10 +0100 |
commit | 7b375939be901cf2114916193da9f4b9864f0504 (patch) | |
tree | 8fceafb2b1cc3817ee9f9d39eb9509f2d8e93033 /ref.c | |
download | uwu-std-7b375939be901cf2114916193da9f4b9864f0504.tar.xz |
Diffstat (limited to 'ref.c')
-rw-r--r-- | ref.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -0,0 +1,20 @@ +#include "common/err.h" +#include "api/ref.h" +#include "api/util.h" + +UwUVMValue uwu_call(UwUVMArgs *args) +{ + uwuutil_require_min("ref.call", args, 1); + + UwUVMValue value = uwuvm_get_arg(args, 0); + + if (value.type != &uwuref_type) + error("ref.call requires a function reference as $1\n"); + + return uwuvm_call_function(value.data, args->num - 1, &args->unevaluated[1], args->super); +} + +UwUVMValue uwu_is(UwUVMArgs *args) +{ + return uwuutil_is_type("ref.is", args, &uwuref_type); +} |