From 4b5e4cd1f21582f5e5fa682ab4e4bff252963468 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 29 Nov 2024 12:55:14 -0500 Subject: Change how types handle metamethods --- stdlib/functiontype.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'stdlib/functiontype.c') diff --git a/stdlib/functiontype.c b/stdlib/functiontype.c index ce07c063..b62ef2a7 100644 --- a/stdlib/functiontype.c +++ b/stdlib/functiontype.c @@ -1,6 +1,9 @@ // Logic for handling function type values +#include + #include "datatypes.h" +#include "functiontype.h" #include "tables.h" #include "text.h" #include "types.h" @@ -32,4 +35,9 @@ public Text_t Func$as_text(const void *fn, bool colorize, const TypeInfo_t *type return text; } +public PUREFUNC bool Func$is_none(const void *obj, const TypeInfo_t*) +{ + return *(void**)obj == NULL; +} + // vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0 -- cgit v1.2.3