From 772fcc24f9022dfcd4e01d4ad19d49ba8adda98d Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Tue, 28 Jul 2015 22:38:23 -0400 Subject: [PATCH] Allow `procedure?` to work with procedures from interpreter. --- runtime.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/runtime.c b/runtime.c index 9efed1cf..dc447a6d 100644 --- a/runtime.c +++ b/runtime.c @@ -739,6 +739,14 @@ object Cyc_is_procedure(object o) { tag == closureN_tag || tag == primitive_tag) { return boolean_t; + } else if (tag == cons_tag) { + integer_type l = Cyc_length(o); + if (l.value > 0 && Cyc_is_symbol(car(o)) == boolean_t) { + if (strncmp(((symbol)car(o))->pname, "primitive", 10) == 0 || + strncmp(((symbol)car(o))->pname, "procedure", 10) == 0 ) { + return boolean_t; + } + } } } return boolean_f;