aboutsummaryrefslogtreecommitdiff
path: root/stdlib/functiontype.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-11-29 12:55:14 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-11-29 12:55:14 -0500
commit4b5e4cd1f21582f5e5fa682ab4e4bff252963468 (patch)
treee8fecb01f444c1d392c09255adba5cf6b312b326 /stdlib/functiontype.c
parent0b0e0a0a1d41e9574de8dc17c688a4894c5e7f92 (diff)
Change how types handle metamethods
Diffstat (limited to 'stdlib/functiontype.c')
-rw-r--r--stdlib/functiontype.c8
1 files changed, 8 insertions, 0 deletions
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 <stdbool.h>
+
#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