Commit 9b81339494a6f94410d17776b39f99a68b0e82a8

Thomas de Grivel 2024-07-31T16:41:24

wip httpd

diff --git a/lib/kc3/0.1/bool.facts b/lib/kc3/0.1/bool.facts
new file mode 100644
index 0000000..d5ea7ac
--- /dev/null
+++ b/lib/kc3/0.1/bool.facts
@@ -0,0 +1,5 @@
+%{module: KC3.Facts.Dump,
+  version: 1}
+replace {Bool, :is_a, :module}
+replace {Bool, :symbol, Bool.cast}
+replace {Bool.cast, :symbol_value, cfn Bool "bool_init_cast" (Result, Sym, Tag)}
diff --git a/libkc3/env.c b/libkc3/env.c
index 694ea06..5ffd4fa 100644
--- a/libkc3/env.c
+++ b/libkc3/env.c
@@ -3146,7 +3146,7 @@ s_tag * env_while (s_env *env, const s_tag *cond, const s_tag *body,
   s_call cond_cast = {0};
   s_tag tmp = {0};
   call_init_call_cast(&cond_cast, &g_sym_Bool);
-  if (! tag_init_copy(&cond_cast.arguments->tag, cond))
+  if (! tag_init_copy(&list_next(cond_cast.arguments)->tag, cond))
     goto ko;
   while (1) {
     tag_clean(&tmp);
@@ -3166,4 +3166,4 @@ s_tag * env_while (s_env *env, const s_tag *cond, const s_tag *body,
   tag_clean(&tmp);
   call_clean(&cond_cast);
   return NULL;
-        }
+}