]> git.lizzy.rs Git - uwu-lang.git/blobdiff - api/ref.c
Add :ref module and refactor type handling
[uwu-lang.git] / api / ref.c
index f66ae19e69d3f403af1d9b5905f9db04dc96e112..43eb68e4cb0b95d3bb35f7e75211a35e22ea5b5c 100644 (file)
--- a/api/ref.c
+++ b/api/ref.c
@@ -1,20 +1,25 @@
 #include "../src/util.h"
 #include "ref.h"
 
-UwUVMValue uwuref_create(UwUVMFunction *function)
+UwUVMValue uwuref_create(UwUVMFunction *value)
 {
        return (UwUVMValue) {
                .type = &uwuref_type,
-               .data = function,
+               .data = value,
        };
 }
 
-static void *uwuref_copy(void *data)
+UwUVMFunction *uwuref_get(UwUVMValue value)
+{
+       return value.data;
+}
+
+static void *uwuref_clone(void *data)
 {
        return data;
 }
 
-static void uwuref_delete(void *data)
+static void uwuref_delet(void *data)
 {
        (void) data;
 }
@@ -25,7 +30,7 @@ static char *uwuref_print(void *data)
 }
 
 UwUVMType uwuref_type = {
-       .copy = &uwuref_copy,
-       .delete = &uwuref_delete,
+       .clone = &uwuref_clone,
+       .delet = &uwuref_delet,
        .print = &uwuref_print,
 };