Commit 4d6a58b632ee1175991a1c084028a1d85444ff2a

Thomas de Grivel 2024-06-25T09:44:03

remove unused function call_op_get

diff --git a/libc3/call.c b/libc3/call.c
index 82a3dd3..4daad57 100644
--- a/libc3/call.c
+++ b/libc3/call.c
@@ -162,76 +162,3 @@ s_str * call_inspect (const s_call *call, s_str *dest)
   assert(tmp.wpos == tmp.size);
   return buf_to_str(&tmp, dest);
 }
-
-bool call_op_get (s_call *call, s_facts *facts)
-{
-  s_facts_cursor cursor;
-  const s_fact *fact;
-  s_tag tag_ident;
-  s_tag tag_is_a;
-  s_tag tag_macro;
-  s_tag tag_module_name;
-  s_tag tag_special_operator;
-  s_tag tag_sym;
-  s_tag tag_symbol;
-  s_tag tag_symbol_value;
-  s_tag tag_var;
-  tag_init_ident(&tag_ident, &call->ident);
-  tag_init_sym(  &tag_is_a, &g_sym_is_a);
-  tag_init_sym(  &tag_macro, &g_sym_macro);
-  tag_init_sym(  &tag_module_name, call->ident.module);
-  tag_init_sym(  &tag_special_operator, &g_sym_special_operator);
-  tag_init_sym(  &tag_sym, call->ident.sym);
-  tag_init_sym(  &tag_symbol, &g_sym_symbol);
-  tag_init_sym(  &tag_symbol, &g_sym_symbol_value);
-  tag_init_var(  &tag_var, &g_sym_Tag);
-  if (! facts_find_fact_by_tags(facts, &tag_module_name,
-                                &tag_symbol, &tag_ident, &fact))
-    return false;
-  if (! fact) {
-    err_write_1("call_op_get: symbol ");
-    err_write_1(call->ident.sym->str.ptr.pchar);
-    err_write_1(" not found in module ");
-    err_write_1(call->ident.module->str.ptr.pchar);
-    err_write_1("\n");
-    return false;
-  }
-  if (! facts_with_tags(facts, &cursor, &tag_ident, &tag_symbol_value,
-                        &tag_var))
-    return false;
-  if (! facts_cursor_next(&cursor, &fact))
-    return false;
-  if (fact) {
-    if (tag_var.type == TAG_CFN)
-      call->cfn = cfn_new_copy(&tag_var.data.cfn);
-    else if (tag_var.type == TAG_FN)
-      call->fn = fn_new_copy(&tag_var.data.fn);
-    else {
-      err_write_1("call_op_get: ");
-      err_inspect_ident(&call->ident);
-      err_puts(" is not a function");
-      facts_cursor_clean(&cursor);
-      return false;
-    }
-  }
-  facts_cursor_clean(&cursor);
-  if (! facts_find_fact_by_tags(facts, &tag_ident, &tag_is_a,
-                                &tag_macro, &fact))
-    return false;
-  if (fact) {
-    if (call->fn)
-      call->fn->macro = true;
-    if (call->cfn)
-      call->cfn->macro = true;
-  }
-  if (! facts_find_fact_by_tags(facts, &tag_ident, &tag_is_a,
-                                &tag_special_operator, &fact))
-    return false;
-  if (fact) {
-    if (call->fn)
-      call->fn->special_operator = true;
-    if (call->cfn)
-      call->cfn->special_operator = true;
-  }
-  return true;
-}