ref: 9e683ae8cde8033a158230841ad97866e49b27cb
parent: ed591c91cab423a6e1923545ccdc740c1b9ca595
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Tue Dec 24 23:47:57 EST 2024
environment: don't include keywords - missed while redoing with qp tries
--- a/builtins.c
+++ b/builtins.c
@@ -193,7 +193,7 @@
const char *k = nil;
symbol_t *v;
while(Tnext(FL(symtab), &k, (void**)&v)){
- if(v->binding != UNBOUND)
+ if(v->binding != UNBOUND && !fl_is_keyword_name(v->name, strlen(v->name)))
lst = fl_cons(tagptr(v, TAG_SYM), lst);
}
fl_free_gc_handles(1);
--- a/flisp.c
+++ b/flisp.c
@@ -165,7 +165,7 @@
// symbol table ---------------------------------------------------------------
-static inline bool
+bool
fl_is_keyword_name(const char *str, size_t len)
{
return (str[0] == ':' || str[len-1] == ':') && str[1] != '\0';
--- a/flisp.h
+++ b/flisp.h
@@ -192,6 +192,7 @@
value_t fl_cons(value_t a, value_t b);
value_t fl_list2(value_t a, value_t b);
value_t fl_listn(size_t n, ...);
+bool fl_is_keyword_name(const char *str, size_t len);
bool fl_isnumber(value_t v);
value_t alloc_vector(size_t n, int init);