diff --git a/include/picrin/value.h b/include/picrin/value.h index 410f2b06..0ee56e30 100644 --- a/include/picrin/value.h +++ b/include/picrin/value.h @@ -35,4 +35,6 @@ struct pic_symbol { char *name; }; +pic_value pic_obj_value(struct pic_object *obj); + #endif diff --git a/src/value.c b/src/value.c new file mode 100644 index 00000000..778d2bc9 --- /dev/null +++ b/src/value.c @@ -0,0 +1,11 @@ +#include "picrin.h" + +pic_value +pic_obj_value(struct pic_object *obj) +{ + pic_value v; + + v.vtype = PIC_VTYPE_HEAP; + v.u.data = obj; + return v; +}