Commit 6c8dfb5c254963ebf70e3b5b0ae203e8a135f764

Thomas de Grivel 2024-03-21T06:03:10

sym

diff --git a/libc3/env.c b/libc3/env.c
index cfbc77a..7c8821c 100644
--- a/libc3/env.c
+++ b/libc3/env.c
@@ -1386,7 +1386,7 @@ bool env_module_is_loading (s_env *env, const s_sym *module)
   assert(env);
   assert(module);
   tag_init_sym(&tag_module, module);
-  tag_init_sym(&tag_is_loading, sym_1("is_loading"));
+  tag_init_sym(&tag_is_loading, &g_sym_is_loading);
   tag_init_bool(&tag_true, true);
   facts_with_tags(&env->facts, &cursor, &tag_module, &tag_is_loading,
                   &tag_true);
@@ -1407,7 +1407,7 @@ void env_module_is_loading_set (s_env *env, const s_sym *module,
   assert(env);
   assert(module);
   tag_init_sym(&tag_module, module);
-  tag_init_sym(&tag_is_loading, sym_1("is_loading"));
+  tag_init_sym(&tag_is_loading, &g_sym_is_loading);
   tag_init_bool(&tag_true, true);
   if (is_loading)
     facts_replace_tags(&env->facts, &tag_module, &tag_is_loading,
@@ -1793,7 +1793,7 @@ f_clean env_struct_type_get_clean (s_env *env, const s_sym *module)
   f_clean tmp;
   const s_sym *type;
   tag_init_sym(&tag_module, module);
-  tag_init_sym(&tag_clean, sym_1("clean"));
+  tag_init_sym(&tag_clean, &g_sym_clean);
   tag_init_var(&tag_var);
   facts_with(&env->facts, &cursor, (t_facts_spec) {
       &tag_module, &tag_clean, &tag_var, NULL, NULL });
diff --git a/libc3/sym.c b/libc3/sym.c
index 8fe1fa1..4ed9bee 100644
--- a/libc3/sym.c
+++ b/libc3/sym.c
@@ -70,12 +70,14 @@ const s_sym g_sym_Var             = {{{NULL},  3, {"Var"}}};
 const s_sym g_sym_Void            = {{{NULL},  4, {"Void"}}};
 const s_sym g_sym_arity           = {{{NULL},  5, {"arity"}}};
 const s_sym g_sym_cast            = {{{NULL},  4, {"cast"}}};
+const s_sym g_sym_clean           = {{{NULL},  5, {"clean"}}};
 const s_sym g_sym_defstruct       = {{{NULL},  9, {"defstruct"}}};
 const s_sym g_sym_do              = {{{NULL},  2, {"do"}}};
 const s_sym g_sym_else            = {{{NULL},  4, {"else"}}};
 const s_sym g_sym_end             = {{{NULL},  3, {"end"}}};
 const s_sym g_sym_if_then_else    = {{{NULL}, 12, {"if_then_else"}}};
 const s_sym g_sym_is_a            = {{{NULL},  4, {"is_a"}}};
+const s_sym g_sym_is_loading      = {{{NULL}, 10, {"is_loading"}}};
 const s_sym g_sym_load_time       = {{{NULL},  9, {"load_time"}}};
 const s_sym g_sym_macro           = {{{NULL},  5, {"macro"}}};
 const s_sym g_sym_module          = {{{NULL},  6, {"module"}}};
@@ -325,12 +327,14 @@ void sym_init_g_sym (void)
   sym_register(&g_sym_Void, NULL);
   sym_register(&g_sym_arity, NULL);
   sym_register(&g_sym_cast, NULL);
+  sym_register(&g_sym_clean, NULL);
   sym_register(&g_sym_defstruct, NULL);
   sym_register(&g_sym_do, NULL);
   sym_register(&g_sym_else, NULL);
   sym_register(&g_sym_end, NULL);
   sym_register(&g_sym_if_then_else, NULL);
   sym_register(&g_sym_is_a, NULL);
+  sym_register(&g_sym_is_loading, NULL);
   sym_register(&g_sym_load_time, NULL);
   sym_register(&g_sym_macro, NULL);
   sym_register(&g_sym_module, NULL);
diff --git a/libc3/sym.h b/libc3/sym.h
index 26ca125..b610900 100644
--- a/libc3/sym.h
+++ b/libc3/sym.h
@@ -75,12 +75,14 @@ extern const s_sym g_sym_Var;
 extern const s_sym g_sym_Void;
 extern const s_sym g_sym_arity;
 extern const s_sym g_sym_cast;
+extern const s_sym g_sym_clean;
 extern const s_sym g_sym_defstruct;
 extern const s_sym g_sym_do;
 extern const s_sym g_sym_else;
 extern const s_sym g_sym_end;
 extern const s_sym g_sym_if_then_else;
 extern const s_sym g_sym_is_a;
+extern const s_sym g_sym_is_loading;
 extern const s_sym g_sym_load_time;
 extern const s_sym g_sym_macro;
 extern const s_sym g_sym_module;