diff --git a/lib/c3/0.1/array.facts b/lib/c3/0.1/array.facts
index ade2085..b19dcc1 100644
--- a/lib/c3/0.1/array.facts
+++ b/lib/c3/0.1/array.facts
@@ -1,7 +1,7 @@
%{module: C3.Facts.Dump,
version: 1}
add {Array, :is_a, :module}
-add {Array, :symbol, Array.cast}
+replace {Array, :symbol, Array.cast}
+replace {Array.cast, :symbol_value, cfn Array "array_init_cast" (Result, Tag)}
add {Array, :symbol, Array.data}
-replace {Array.cast, :cfn, cfn Array "array_init_cast" (Result, Tag)}
-replace {Array.data, :cfn, cfn Tag "array_data_tag" (Tag, Tag, Result)}
+replace {Array.data, :symbol_value, cfn Tag "array_data_tag" (Tag, Tag, Result)}
diff --git a/lib/c3/0.1/c3.facts b/lib/c3/0.1/c3.facts
index 977e6f0..3939469 100644
--- a/lib/c3/0.1/c3.facts
+++ b/lib/c3/0.1/c3.facts
@@ -5,175 +5,175 @@ replace {C3, :operator, C3.operator00}
replace {C3.operator00, :is_a, :operator}
replace {C3.operator00, :symbol, :"()"}
replace {C3.operator00, :arity, 1}
-replace {C3.operator00, :cfn, cfn Tag "tag_paren" (Tag, Result)}
+replace {C3.operator00, :symbol_value, cfn Tag "tag_paren" (Tag, Result)}
replace {C3.operator00, :operator_precedence, 13}
replace {C3.operator00, :operator_associativity, :left}
add {C3, :operator, C3.operator01}
replace {C3.operator01, :is_a, :operator}
replace {C3.operator01, :symbol, :"[]"}
replace {C3.operator01, :arity, 2}
-replace {C3.operator01, :cfn, cfn Tag "tag_brackets" (Tag, Tag, Result)}
+replace {C3.operator01, :symbol_value, cfn Tag "tag_brackets" (Tag, Tag, Result)}
replace {C3.operator01, :operator_precedence, 13}
replace {C3.operator01, :operator_associativity, :left}
add {C3, :operator, C3.operator_pin}
replace {C3.operator_pin, :is_a, :operator}
replace {C3.operator_pin, :symbol, :^}
replace {C3.operator_pin, :arity, 1}
-replace {C3.operator_pin, :cfn, cfn Tag "c3_pin" (Tag, Result)}
+replace {C3.operator_pin, :symbol_value, cfn Tag "c3_pin" (Tag, Result)}
replace {C3.operator_pin, :operator_precedence, 12}
replace {C3.operator_pin, :operator_associativity, :right}
add {C3, :operator, C3.operator02}
replace {C3.operator02, :is_a, :operator}
replace {C3.operator02, :symbol, :!}
replace {C3.operator02, :arity, 1}
-replace {C3.operator02, :cfn, cfn Bool "tag_not" (Tag, Result)}
+replace {C3.operator02, :symbol_value, cfn Bool "tag_not" (Tag, Result)}
replace {C3.operator02, :operator_precedence, 12}
replace {C3.operator02, :operator_associativity, :right}
add {C3, :operator, C3.operator03}
replace {C3.operator03, :is_a, :operator}
replace {C3.operator03, :symbol, :~}
replace {C3.operator03, :arity, 1}
-replace {C3.operator03, :cfn, cfn Tag "tag_bnot" (Tag, Result)}
+replace {C3.operator03, :symbol_value, cfn Tag "tag_bnot" (Tag, Result)}
replace {C3.operator03, :operator_precedence, 12}
replace {C3.operator03, :operator_associativity, :right}
add {C3, :operator, C3.operator04}
replace {C3.operator04, :is_a, :operator}
replace {C3.operator04, :symbol, :-}
replace {C3.operator04, :arity, 1}
-replace {C3.operator04, :cfn, cfn Tag "tag_neg" (Tag, Result)}
+replace {C3.operator04, :symbol_value, cfn Tag "tag_neg" (Tag, Result)}
replace {C3.operator04, :operator_precedence, 12}
replace {C3.operator04, :operator_associativity, :right}
add {C3, :operator, C3.operator05}
replace {C3.operator05, :is_a, :operator}
replace {C3.operator05, :symbol, :*}
replace {C3.operator05, :arity, 2}
-replace {C3.operator05, :cfn, cfn Tag "tag_mul" (Tag, Tag, Result)}
+replace {C3.operator05, :symbol_value, cfn Tag "tag_mul" (Tag, Tag, Result)}
replace {C3.operator05, :operator_precedence, 11}
replace {C3.operator05, :operator_associativity, :left}
add {C3, :operator, C3.operator06}
replace {C3.operator06, :is_a, :operator}
replace {C3.operator06, :symbol, :/}
replace {C3.operator06, :arity, 2}
-replace {C3.operator06, :cfn, cfn Tag "tag_div" (Tag, Tag, Result)}
+replace {C3.operator06, :symbol_value, cfn Tag "tag_div" (Tag, Tag, Result)}
replace {C3.operator06, :operator_precedence, 11}
replace {C3.operator06, :operator_associativity, :left}
add {C3, :operator, C3.operator07}
replace {C3.operator07, :is_a, :operator}
replace {C3.operator07, :symbol, :mod}
replace {C3.operator07, :arity, 2}
-replace {C3.operator07, :cfn, cfn Tag "tag_mod" (Tag, Tag, Result)}
+replace {C3.operator07, :symbol_value, cfn Tag "tag_mod" (Tag, Tag, Result)}
replace {C3.operator07, :operator_precedence, 11}
replace {C3.operator07, :operator_associativity, :left}
add {C3, :operator, C3.operator_add}
replace {C3.operator_add, :is_a, :operator}
replace {C3.operator_add, :symbol, :+}
replace {C3.operator_add, :arity, 2}
-replace {C3.operator_add, :cfn, cfn Tag "tag_add" (Tag, Tag, Result)}
+replace {C3.operator_add, :symbol_value, cfn Tag "tag_add" (Tag, Tag, Result)}
replace {C3.operator_add, :operator_precedence, 10}
replace {C3.operator_add, :operator_associativity, :left}
add {C3, :operator, C3.operator_addi}
replace {C3.operator_addi, :is_a, :operator}
replace {C3.operator_addi, :symbol, :+i}
replace {C3.operator_addi, :arity, 2}
-replace {C3.operator_addi, :cfn, cfn Tag "tag_addi" (Tag, Tag, Result)}
+replace {C3.operator_addi, :symbol_value, cfn Tag "tag_addi" (Tag, Tag, Result)}
replace {C3.operator_addi, :operator_precedence, 10}
replace {C3.operator_addi, :operator_associativity, :left}
add {C3, :operator, C3.operator_sub}
replace {C3.operator_sub, :is_a, :operator}
replace {C3.operator_sub, :symbol, :-}
replace {C3.operator_sub, :arity, 2}
-replace {C3.operator_sub, :cfn, cfn Tag "tag_sub" (Tag, Tag, Result)}
+replace {C3.operator_sub, :symbol_value, cfn Tag "tag_sub" (Tag, Tag, Result)}
replace {C3.operator_sub, :operator_precedence, 10}
replace {C3.operator_sub, :operator_associativity, :left}
add {C3, :operator, C3.operator10}
replace {C3.operator10, :is_a, :operator}
replace {C3.operator10, :symbol, :<<}
replace {C3.operator10, :arity, 2}
-replace {C3.operator10, :cfn, cfn Tag "tag_shift_left" (Tag, Tag, Result)}
+replace {C3.operator10, :symbol_value, cfn Tag "tag_shift_left" (Tag, Tag, Result)}
replace {C3.operator10, :operator_precedence, 9}
replace {C3.operator10, :operator_associativity, :left}
add {C3, :operator, C3.operator11}
replace {C3.operator11, :is_a, :operator}
replace {C3.operator11, :symbol, :>>}
replace {C3.operator11, :arity, 2}
-replace {C3.operator11, :cfn, cfn Tag "tag_shift_right" (Tag, Tag, Result)}
+replace {C3.operator11, :symbol_value, cfn Tag "tag_shift_right" (Tag, Tag, Result)}
replace {C3.operator11, :operator_precedence, 9}
replace {C3.operator11, :operator_associativity, :left}
add {C3, :operator, C3.operator12}
replace {C3.operator12, :is_a, :operator}
replace {C3.operator12, :symbol, :<}
replace {C3.operator12, :arity, 2}
-replace {C3.operator12, :cfn, cfn Bool "tag_lt" (Tag, Tag, Result)}
+replace {C3.operator12, :symbol_value, cfn Bool "tag_lt" (Tag, Tag, Result)}
replace {C3.operator12, :operator_precedence, 8}
replace {C3.operator12, :operator_associativity, :left}
add {C3, :operator, C3.operator13}
replace {C3.operator13, :symbol, :<=}
replace {C3.operator13, :is_a, :operator}
replace {C3.operator13, :arity, 2}
-replace {C3.operator13, :cfn, cfn Bool "tag_lte" (Tag, Tag, Result)}
+replace {C3.operator13, :symbol_value, cfn Bool "tag_lte" (Tag, Tag, Result)}
replace {C3.operator13, :operator_precedence, 8}
replace {C3.operator13, :operator_associativity, :left}
add {C3, :operator, C3.operator14}
replace {C3.operator14, :symbol, :>}
replace {C3.operator14, :is_a, :operator}
replace {C3.operator14, :arity, 2}
-replace {C3.operator14, :cfn, cfn Bool "tag_gt" (Tag, Tag, Result)}
+replace {C3.operator14, :symbol_value, cfn Bool "tag_gt" (Tag, Tag, Result)}
replace {C3.operator14, :operator_precedence, 8}
replace {C3.operator14, :operator_associativity, :left}
add {C3, :operator, C3.operator15}
replace {C3.operator15, :symbol, :>=}
replace {C3.operator15, :is_a, :operator}
replace {C3.operator15, :arity, 2}
-replace {C3.operator15, :cfn, cfn Bool "tag_gte" (Tag, Tag, Result)}
+replace {C3.operator15, :symbol_value, cfn Bool "tag_gte" (Tag, Tag, Result)}
replace {C3.operator15, :operator_precedence, 8}
replace {C3.operator15, :operator_associativity, :left}
add {C3, :operator, C3.operator16}
replace {C3.operator16, :is_a, :operator}
replace {C3.operator16, :symbol, :==}
replace {C3.operator16, :arity, 2}
-replace {C3.operator16, :cfn, cfn Bool "tag_eq" (Tag, Tag, Result)}
+replace {C3.operator16, :symbol_value, cfn Bool "tag_eq" (Tag, Tag, Result)}
replace {C3.operator16, :operator_precedence, 7}
replace {C3.operator16, :operator_associativity, :left}
add {C3, :operator, C3.operator17}
replace {C3.operator17, :is_a, :operator}
replace {C3.operator17, :symbol, :!=}
replace {C3.operator17, :arity, 2}
-replace {C3.operator17, :cfn, cfn Bool "tag_not_eq" (Tag, Tag, Result)}
+replace {C3.operator17, :symbol_value, cfn Bool "tag_not_eq" (Tag, Tag, Result)}
replace {C3.operator17, :operator_precedence, 7}
replace {C3.operator17, :operator_associativity, :left}
add {C3, :operator, C3.operator18}
replace {C3.operator18, :is_a, :operator}
replace {C3.operator18, :symbol, :&}
replace {C3.operator18, :arity, 2}
-replace {C3.operator18, :cfn, cfn Tag "tag_band" (Tag, Tag, Result)}
+replace {C3.operator18, :symbol_value, cfn Tag "tag_band" (Tag, Tag, Result)}
replace {C3.operator18, :operator_precedence, 6}
replace {C3.operator18, :operator_associativity, :left}
add {C3, :operator, C3.operator19}
replace {C3.operator19, :is_a, :operator}
replace {C3.operator19, :symbol, :^}
replace {C3.operator19, :arity, 2}
-replace {C3.operator19, :cfn, cfn Tag "tag_bxor" (Tag, Tag, Result)}
+replace {C3.operator19, :symbol_value, cfn Tag "tag_bxor" (Tag, Tag, Result)}
replace {C3.operator19, :operator_precedence, 5}
replace {C3.operator19, :operator_associativity, :left}
add {C3, :operator, C3.operator20}
replace {C3.operator20, :is_a, :operator}
replace {C3.operator20, :symbol, :bor}
replace {C3.operator20, :arity, 2}
-replace {C3.operator20, :cfn, cfn Tag "tag_bor" (Tag, Tag, Result)}
+replace {C3.operator20, :symbol_value, cfn Tag "tag_bor" (Tag, Tag, Result)}
replace {C3.operator20, :operator_precedence, 4}
replace {C3.operator20, :operator_associativity, :left}
add {C3, :operator, C3.operator21}
replace {C3.operator21, :is_a, :operator}
replace {C3.operator21, :symbol, :&&}
replace {C3.operator21, :arity, 2}
-replace {C3.operator21, :cfn, cfn Bool "tag_and" (Tag, Tag, Result)}
+replace {C3.operator21, :symbol_value, cfn Bool "tag_and" (Tag, Tag, Result)}
replace {C3.operator21, :operator_precedence, 3}
replace {C3.operator21, :operator_associativity, :left}
add {C3, :operator, C3.operator22}
replace {C3.operator22, :is_a, :operator}
replace {C3.operator22, :symbol, :||}
replace {C3.operator22, :arity, 2}
-replace {C3.operator22, :cfn, cfn Bool "tag_or" (Tag, Tag, Result)}
+replace {C3.operator22, :symbol_value, cfn Bool "tag_or" (Tag, Tag, Result)}
replace {C3.operator22, :operator_precedence, 2}
replace {C3.operator22, :operator_associativity, :left}
add {C3, :operator, C3.operator23}
@@ -181,40 +181,42 @@ replace {C3.operator23, :is_a, :operator}
replace {C3.operator23, :arity, 2}
add {C3.operator23, :is_a, :special_operator}
replace {C3.operator23, :symbol, :=}
-replace {C3.operator23, :cfn, cfn Tag "tag_equal" (Tag, Tag, Result)}
+replace {C3.operator23, :symbol_value, cfn Tag "tag_equal" (Tag, Tag, Result)}
replace {C3.operator23, :operator_precedence, 1}
replace {C3.operator23, :operator_associativity, :right}
-replace {C3.break, :cfn, cfn Void "c3_break" ()}
+replace {C3.break, :symbol_value, cfn Void "c3_break" ()}
replace {C3, :symbol, C3.license}
-replace {C3.license, :cfn, cfn Void "c3_license" ()}
+replace {C3.license, :symbol_value, cfn Void "c3_license" ()}
add {C3, :symbol, C3.type}
-replace {C3.type, :cfn, cfn Sym "tag_type" (Tag, Result)}
+replace {C3.type, :symbol_value, cfn Sym "tag_type" (Tag, Result)}
add {C3, :symbol, C3.facts_next_id}
-replace {C3.facts_next_id, :cfn, cfn Uw "c3_facts_next_id" (Result)}
+replace {C3.facts_next_id, :symbol_value, cfn Uw "c3_facts_next_id" (Result)}
add {C3, :symbol, C3.getenv}
-replace {C3.getenv, :cfn, cfn Str "c3_getenv" (Str, Result)}
+replace {C3.getenv, :symbol_value, cfn Str "c3_getenv" (Str, Result)}
add {C3, :symbol, C3.dlopen}
-replace {C3.dlopen, :cfn, cfn Ptr "c3_dlopen" (Str, Result)}
+replace {C3.dlopen, :symbol_value, cfn Ptr "c3_dlopen" (Str, Result)}
add {C3, :symbol, C3.first}
-replace {C3.first, :fn, fn {
+replace {C3.first, :symbol_value, fn {
([a | _b]) { a }
({a, _b}) { a }
({a, _b, _c}) { a }
({a, _b, _c, _d}) { a }
}}
add {C3, :symbol, C3.fib}
-replace {C3.fib, :fn, fn { (0) { 1 }
- (1) { 1 }
- (x) { fib(x - 1) + fib(x - 2) } }}
+replace {C3.fib, :symbol_value, fn {
+ (0) { 1 }
+ (1) { 1 }
+ (x) { fib(x - 1) + fib(x - 2) }
+}}
add {C3, :symbol, C3.if_then_else}
replace {C3.if_then_else, :arity, 3}
replace {C3.if_then_else, :is_a, :special_operator}
-replace {C3.if_then_else, :cfn, cfn Tag "c3_if_then_else" (Tag, Tag, Tag, Result)}
+replace {C3.if_then_else, :symbol_value, cfn Tag "c3_if_then_else" (Tag, Tag, Tag, Result)}
add {C3, :symbol, C3.sqrt}
-replace {C3.sqrt, :cfn, cfn Tag "tag_sqrt" (Tag, Result)}
+replace {C3.sqrt, :symbol_value, cfn Tag "tag_sqrt" (Tag, Result)}
add {C3, :symbol, C3.hash}
-replace {C3.hash, :cfn, cfn Uw "tag_hash_uw" (Tag)}
+replace {C3.hash, :symbol_value, cfn Uw "tag_hash_uw" (Tag)}
add {C3, :symbol, C3.defmodule}
replace {C3.defmodule, :arity, 2}
replace {C3.defmodule, :is_a, :special_operator}
-replace {C3.defmodule, :cfn, cfn Tag "c3_defmodule" (Sym, Block, Result)}
+replace {C3.defmodule, :symbol_value, cfn Tag "c3_defmodule" (Sym, Block, Result)}
diff --git a/lib/c3/0.1/complex.facts b/lib/c3/0.1/complex.facts
index 386ac1c..3049c9a 100644
--- a/lib/c3/0.1/complex.facts
+++ b/lib/c3/0.1/complex.facts
@@ -2,4 +2,4 @@
version: 1}
replace {Complex, :is_a, :module}
replace {Complex, :symbol, Complex.cast}
-replace {Complex.cast, :cfn, cfn Complex "pcomplex_init_cast" (Result, Tag)}
+replace {Complex.cast, :symbol_value, cfn Complex "pcomplex_init_cast" (Result, Tag)}
diff --git a/lib/c3/0.1/f32.facts b/lib/c3/0.1/f32.facts
index a48256a..97420e9 100644
--- a/lib/c3/0.1/f32.facts
+++ b/lib/c3/0.1/f32.facts
@@ -2,4 +2,4 @@
version: 1}
replace {F32, :is_a, :module}
replace {F32, :symbol, F32.cast}
-replace {F32.cast, :cfn, cfn F32 "f32_init_cast" (Result, Tag)}
+replace {F32.cast, :symbol_value, cfn F32 "f32_init_cast" (Result, Tag)}
diff --git a/lib/c3/0.1/f64.facts b/lib/c3/0.1/f64.facts
index 2b6ae72..fad6ffa 100644
--- a/lib/c3/0.1/f64.facts
+++ b/lib/c3/0.1/f64.facts
@@ -2,4 +2,4 @@
version: 1}
replace {F64, :is_a, :module}
replace {F64, :symbol, F64.cast}
-replace {F64.cast, :cfn, cfn F64 "f64_init_cast" (Result, Tag)}
+replace {F64.cast, :symbol_value, cfn F64 "f64_init_cast" (Result, Tag)}
diff --git a/lib/c3/0.1/integer.facts b/lib/c3/0.1/integer.facts
index bcd4506..09cb5fc 100644
--- a/lib/c3/0.1/integer.facts
+++ b/lib/c3/0.1/integer.facts
@@ -2,4 +2,4 @@
version: 1}
replace {Integer, :is_a, :module}
replace {Integer, :symbol, Integer.cast}
-replace {Integer.cast, :cfn, cfn Integer "integer_init_cast" (Result, Tag)}
+replace {Integer.cast, :symbol_value, cfn Integer "integer_init_cast" (Result, Tag)}
diff --git a/lib/c3/0.1/list.facts b/lib/c3/0.1/list.facts
index a2edf02..17a8cad 100644
--- a/lib/c3/0.1/list.facts
+++ b/lib/c3/0.1/list.facts
@@ -4,8 +4,8 @@ add {List, :is_a, :module}
add {List, :symbol, List.cast}
add {List, :symbol, List.map}
add {List, :symbol, List.reverse}
-replace {List.cast, :cfn, cfn List "list_init_cast" (Result, Tag)}
-replace {List.map, :fn, fn {
+replace {List.cast, :symbol_value, cfn List "list_init_cast" (Result, Tag)}
+replace {List.map, :symbol_value, fn {
([], _) do
[]
end
@@ -13,7 +13,7 @@ replace {List.map, :fn, fn {
[f(a) | List.map(b, f)]
}
}}
-replace {List.reverse, :fn, fn {
+replace {List.reverse, :symbol_value, fn {
(x) { List.reverse(x, []) }
([], acc) { acc }
([a | b], acc) { List.reverse(b, [a | acc]) }
diff --git a/lib/c3/0.1/map.facts b/lib/c3/0.1/map.facts
index de43112..1e77a2a 100644
--- a/lib/c3/0.1/map.facts
+++ b/lib/c3/0.1/map.facts
@@ -4,8 +4,8 @@ add {Map, :is_a, :module}
add {Map, :symbol, Map.cast}
add {Map, :symbol, Map.map}
add {Map, :symbol, Map.to_list}
-replace {Map.cast, :cfn, cfn Map "map_cast" (Tag, Result)}
-replace {Map.map, :cfn, cfn List "map_map" (Map, Fn, Result)}
-replace {Map.to_list, :fn, fn (%{} = map) {
+replace {Map.cast, :symbol_value, cfn Map "map_cast" (Tag, Result)}
+replace {Map.map, :symbol_value, cfn List "map_map" (Map, Fn, Result)}
+replace {Map.to_list, :symbol_value, fn (%{} = map) {
Map.map(map, fn (k, v) { {k, v} })
}}
diff --git a/lib/c3/0.1/ptr.facts b/lib/c3/0.1/ptr.facts
index 05ec535..aba9455 100644
--- a/lib/c3/0.1/ptr.facts
+++ b/lib/c3/0.1/ptr.facts
@@ -2,4 +2,4 @@
version: 1}
replace {Ptr, :is_a, :module}
replace {Ptr, :symbol, Ptr.cast}
-replace {Ptr.cast, :cfn, cfn Ptr "ptr_init_cast" (Result, Tag)}
+replace {Ptr.cast, :symbol_value, cfn Ptr "ptr_init_cast" (Result, Tag)}
diff --git a/lib/c3/0.1/ptr_free.facts b/lib/c3/0.1/ptr_free.facts
index 7b6da65..ccdd3d9 100644
--- a/lib/c3/0.1/ptr_free.facts
+++ b/lib/c3/0.1/ptr_free.facts
@@ -2,4 +2,4 @@
version: 1}
replace {PtrFree, :is_a, :module}
replace {PtrFree, :symbol, PtrFree.cast}
-replace {PtrFree.cast, :cfn, cfn PtrFree "ptr_free_init_cast" (Result, Tag)}
+replace {PtrFree.cast, :symbol_value, cfn PtrFree "ptr_free_init_cast" (Result, Tag)}
diff --git a/lib/c3/0.1/ratio.facts b/lib/c3/0.1/ratio.facts
index 63ea854..60acc37 100644
--- a/lib/c3/0.1/ratio.facts
+++ b/lib/c3/0.1/ratio.facts
@@ -2,4 +2,4 @@
version: 1}
replace {Ratio, :is_a, :module}
replace {Ratio, :symbol, Ratio.cast}
-replace {Ratio.cast, :cfn, cfn Ratio "ratio_init_cast" (Result, Tag)}
+replace {Ratio.cast, :symbol_value, cfn Ratio "ratio_init_cast" (Result, Tag)}
diff --git a/lib/c3/0.1/s16.facts b/lib/c3/0.1/s16.facts
index 8d41dc0..b7c9b40 100644
--- a/lib/c3/0.1/s16.facts
+++ b/lib/c3/0.1/s16.facts
@@ -2,4 +2,4 @@
version: 1}
replace {S16, :is_a, :module}
replace {S16, :symbol, S16.cast}
-replace {S16.cast, :cfn, cfn S16 "s16_init_cast" (Result, Tag)}
+replace {S16.cast, :symbol_value, cfn S16 "s16_init_cast" (Result, Tag)}
diff --git a/lib/c3/0.1/s32.facts b/lib/c3/0.1/s32.facts
index 6b7e7fb..bd47184 100644
--- a/lib/c3/0.1/s32.facts
+++ b/lib/c3/0.1/s32.facts
@@ -2,4 +2,4 @@
version: 1}
replace {S32, :is_a, :module}
replace {S32, :symbol, S32.cast}
-replace {S32.cast, :cfn, cfn S32 "s32_init_cast" (Result, Tag)}
+replace {S32.cast, :symbol_value, cfn S32 "s32_init_cast" (Result, Tag)}
diff --git a/lib/c3/0.1/s64.facts b/lib/c3/0.1/s64.facts
index e970571..8d32745 100644
--- a/lib/c3/0.1/s64.facts
+++ b/lib/c3/0.1/s64.facts
@@ -2,4 +2,4 @@
version: 1}
replace {S64, :is_a, :module}
replace {S64, :symbol, S64.cast}
-replace {S64.cast, :cfn, cfn S64 "s64_init_cast" (Result, Tag)}
+replace {S64.cast, :symbol_value, cfn S64 "s64_init_cast" (Result, Tag)}
diff --git a/lib/c3/0.1/s8.facts b/lib/c3/0.1/s8.facts
index 8b61a03..3d4dce0 100644
--- a/lib/c3/0.1/s8.facts
+++ b/lib/c3/0.1/s8.facts
@@ -2,4 +2,4 @@
version: 1}
replace {S8, :is_a, :module}
replace {S8, :symbol, S8.cast}
-replace {S8.cast, :cfn, cfn S8 "s8_init_cast" (Result, Tag)}
+replace {S8.cast, :symbol_value, cfn S8 "s8_init_cast" (Result, Tag)}
diff --git a/lib/c3/0.1/str.facts b/lib/c3/0.1/str.facts
index 3d582ee..e485096 100644
--- a/lib/c3/0.1/str.facts
+++ b/lib/c3/0.1/str.facts
@@ -2,4 +2,4 @@
version: 1}
replace {Str, :is_a, :module}
replace {Str, :symbol, Str.cast}
-replace {Str.cast, :cfn, cfn Str "str_init_cast" (Result, Tag)}
+replace {Str.cast, :symbol_value, cfn Str "str_init_cast" (Result, Tag)}
diff --git a/lib/c3/0.1/sw.facts b/lib/c3/0.1/sw.facts
index 87dcc64..01309e7 100644
--- a/lib/c3/0.1/sw.facts
+++ b/lib/c3/0.1/sw.facts
@@ -2,4 +2,4 @@
version: 1}
replace {Sw, :is_a, :module}
replace {Sw, :symbol, Sw.cast}
-replace {Sw.cast, :cfn, cfn Sw "sw_init_cast" (Result, Tag)}
+replace {Sw.cast, :symbol_value, cfn Sw "sw_init_cast" (Result, Tag)}
diff --git a/lib/c3/0.1/u16.facts b/lib/c3/0.1/u16.facts
index 9212fde..44f6ac4 100644
--- a/lib/c3/0.1/u16.facts
+++ b/lib/c3/0.1/u16.facts
@@ -2,4 +2,4 @@
version: 1}
replace {U16, :is_a, :module}
replace {U16, :symbol, U16.cast}
-replace {U16.cast, :cfn, cfn U16 "u16_init_cast" (Result, Tag)}
+replace {U16.cast, :symbol_value, cfn U16 "u16_init_cast" (Result, Tag)}
diff --git a/lib/c3/0.1/u32.facts b/lib/c3/0.1/u32.facts
index 25750f2..c4c8f6a 100644
--- a/lib/c3/0.1/u32.facts
+++ b/lib/c3/0.1/u32.facts
@@ -2,4 +2,4 @@
version: 1}
replace {U32, :is_a, :module}
replace {U32, :symbol, U32.cast}
-replace {U32.cast, :cfn, cfn U32 "u32_init_cast" (Result, Tag)}
+replace {U32.cast, :symbol_value, cfn U32 "u32_init_cast" (Result, Tag)}
diff --git a/lib/c3/0.1/u64.facts b/lib/c3/0.1/u64.facts
index 4f208a2..3f70362 100644
--- a/lib/c3/0.1/u64.facts
+++ b/lib/c3/0.1/u64.facts
@@ -2,4 +2,4 @@
version: 1}
replace {U64, :is_a, :module}
replace {U64, :symbol, U64.cast}
-replace {U64.cast, :cfn, cfn U64 "u64_init_cast" (Result, Tag)}
+replace {U64.cast, :symbol_value, cfn U64 "u64_init_cast" (Result, Tag)}
diff --git a/lib/c3/0.1/u8.facts b/lib/c3/0.1/u8.facts
index 09b368e..7393b5d 100644
--- a/lib/c3/0.1/u8.facts
+++ b/lib/c3/0.1/u8.facts
@@ -2,4 +2,4 @@
version: 1}
replace {U8, :is_a, :module}
replace {U8, :symbol, U8.cast}
-replace {U8.cast, :cfn, cfn U8 "u8_init_cast" (Result, Tag)}
+replace {U8.cast, :symbol_value, cfn U8 "u8_init_cast" (Result, Tag)}
diff --git a/lib/c3/0.1/uw.facts b/lib/c3/0.1/uw.facts
index 3f7eb24..084216e 100644
--- a/lib/c3/0.1/uw.facts
+++ b/lib/c3/0.1/uw.facts
@@ -2,4 +2,4 @@
version: 1}
replace {Uw, :is_a, :module}
replace {Uw, :symbol, Uw.cast}
-replace {Uw.cast, :cfn, cfn Uw "uw_init_cast" (Result, Tag)}
+replace {Uw.cast, :symbol_value, cfn Uw "uw_init_cast" (Result, Tag)}
diff --git a/lib/c3/0.1/void.facts b/lib/c3/0.1/void.facts
index ff8456e..39d5dfc 100644
--- a/lib/c3/0.1/void.facts
+++ b/lib/c3/0.1/void.facts
@@ -2,4 +2,4 @@
version: 1}
replace {Void, :is_a, :module}
replace {Void, :symbol, Void.cast}
-replace {Void.cast, :cfn, cfn Void "void_init_cast" (Result, Tag)}
+replace {Void.cast, :symbol_value, cfn Void "void_init_cast" (Result, Tag)}
diff --git a/libc3/call.c b/libc3/call.c
index aa7dc0e..a45072d 100644
--- a/libc3/call.c
+++ b/libc3/call.c
@@ -38,9 +38,7 @@ void call_clean (s_call *call)
bool call_get (s_call *call, s_facts *facts)
{
- s_facts_cursor cursor;
- s_tag tag_cfn;
- s_tag tag_fn;
+ s_facts_with_cursor cursor;
s_tag tag_ident;
s_tag tag_is_a;
s_tag tag_macro;
@@ -49,17 +47,17 @@ bool call_get (s_call *call, s_facts *facts)
s_tag tag_special_operator;
s_tag tag_sym;
s_tag tag_symbol;
+ s_tag tag_symbol_value;
s_tag tag_var;
- tag_init_1( &tag_cfn, ":cfn");
- tag_init_1( &tag_fn, ":fn");
tag_init_ident(&tag_ident, &call->ident);
- tag_init_1( &tag_is_a, ":is_a");
- tag_init_1( &tag_macro, ":macro");
+ tag_init_1( &tag_is_a, ":is_a");
+ tag_init_1( &tag_macro, ":macro");
tag_init_sym( &tag_module_name, call->ident.module);
tag_init_1( &tag_operator, ":operator");
tag_init_1( &tag_special_operator, ":special_operator");
tag_init_sym( &tag_sym, call->ident.sym);
- tag_init_1( &tag_symbol, ":symbol");
+ tag_init_1( &tag_symbol, ":symbol");
+ tag_init_1( &tag_symbol_value, ":symbol_value");
tag_init_var( &tag_var);
if (! facts_find_fact_by_tags(facts, &tag_module_name,
&tag_symbol, &tag_ident) &&
@@ -72,31 +70,23 @@ bool call_get (s_call *call, s_facts *facts)
err_write_1("\n");
return false;
}
- facts_with_tags(facts, &cursor, &tag_ident, &tag_fn, &tag_var);
- if (facts_cursor_next(&cursor)) {
+ if (! facts_with(facts, &cursor, (t_facts_spec) {
+ &tag_ident, &tag_symbol_value, &tag_var, NULL, NULL }))
+ return false;
+ if (facts_with_cursor_next(&cursor)) {
if (tag_var.type == TAG_FN)
call->fn = fn_new_copy(&tag_var.data.fn);
- else {
- err_write_1("call_get: ");
- err_inspect_ident(&call->ident);
- err_puts(" is not a function");
- return false;
- }
- }
- facts_cursor_clean(&cursor);
- tag_init_var(&tag_var);
- facts_with_tags(facts, &cursor, &tag_ident, &tag_cfn, &tag_var);
- if (facts_cursor_next(&cursor)) {
- if (tag_var.type == TAG_CFN)
+ else if (tag_var.type == TAG_CFN)
call->cfn = cfn_new_copy(&tag_var.data.cfn);
else {
err_write_1("call_get: ");
err_inspect_ident(&call->ident);
- err_puts(" is not a C function");
+ err_puts(" is not a function");
+ facts_with_cursor_clean(&cursor);
return false;
}
}
- facts_cursor_clean(&cursor);
+ facts_with_cursor_clean(&cursor);
if (facts_find_fact_by_tags(facts, &tag_ident, &tag_is_a,
&tag_macro)) {
if (call->fn)
@@ -117,8 +107,6 @@ bool call_get (s_call *call, s_facts *facts)
bool call_op_get (s_call *call, s_facts *facts)
{
s_facts_with_cursor cursor;
- s_tag tag_cfn;
- s_tag tag_fn;
s_tag tag_ident;
s_tag tag_is_a;
s_tag tag_macro;
@@ -126,9 +114,8 @@ bool call_op_get (s_call *call, s_facts *facts)
s_tag tag_special_operator;
s_tag tag_sym;
s_tag tag_symbol;
+ s_tag tag_symbol_value;
s_tag tag_var;
- tag_init_1( &tag_cfn, ":cfn");
- tag_init_1( &tag_fn, ":fn");
tag_init_ident(&tag_ident, &call->ident);
tag_init_1( &tag_is_a, ":is_a");
tag_init_1( &tag_macro, ":macro");
@@ -136,6 +123,7 @@ bool call_op_get (s_call *call, s_facts *facts)
tag_init_1( &tag_special_operator, ":special_operator");
tag_init_sym( &tag_sym, call->ident.sym);
tag_init_1( &tag_symbol, ":symbol");
+ tag_init_1( &tag_symbol, ":symbol_value");
tag_init_var( &tag_var);
facts_with(facts, &cursor, (t_facts_spec) {
&tag_module_name,
@@ -152,35 +140,19 @@ bool call_op_get (s_call *call, s_facts *facts)
}
facts_with_cursor_clean(&cursor);
facts_with(facts, &cursor, (t_facts_spec) {
- &tag_ident, &tag_fn, &tag_var,
+ &tag_ident, &tag_symbol_value, &tag_var,
NULL, NULL });
if (facts_with_cursor_next(&cursor)) {
- if (tag_var.type != TAG_FN) {
- err_write_1("call_get: ");
- err_write_1(call->ident.module->str.ptr.pchar);
- err_write_1(".");
- err_write_1(call->ident.sym->str.ptr.pchar);
+ 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_with_cursor_clean(&cursor);
- return false;
- }
- call->fn = fn_new_copy(&tag_var.data.fn);
- }
- facts_with_cursor_clean(&cursor);
- facts_with(facts, &cursor, (t_facts_spec) {
- &tag_ident, &tag_cfn, &tag_var,
- NULL, NULL });
- if (facts_with_cursor_next(&cursor)) {
- if (tag_var.type != TAG_CFN) {
- err_write_1("call_get: ");
- err_write_1(call->ident.module->str.ptr.pchar);
- err_write_1(".");
- err_write_1(call->ident.sym->str.ptr.pchar);
- err_puts(" is not a C function");
- facts_with_cursor_clean(&cursor);
return false;
}
- call->cfn = cfn_new_copy(&tag_var.data.cfn);
}
facts_with_cursor_clean(&cursor);
facts_with(facts, &cursor, (t_facts_spec) {
diff --git a/libc3/ident.c b/libc3/ident.c
index dfa1e81..e315533 100644
--- a/libc3/ident.c
+++ b/libc3/ident.c
@@ -57,8 +57,6 @@ s_tag * ident_get (const s_ident *ident, s_facts *facts, s_tag *dest)
{
s_facts_with_cursor cursor;
const s_sym *module;
- s_tag tag_cfn;
- s_tag tag_fn;
s_tag tag_ident;
s_tag tag_is_a;
s_tag tag_macro;
@@ -66,21 +64,21 @@ s_tag * ident_get (const s_ident *ident, s_facts *facts, s_tag *dest)
s_tag tag_special_operator;
s_tag tag_sym;
s_tag tag_symbol;
+ s_tag tag_symbol_value;
s_tag tag_var;
module = ident->module;
if (! module)
module = g_c3_env.current_module;
if (! module_ensure_loaded(module, facts))
return NULL;
- tag_init_1( &tag_cfn, ":cfn");
- tag_init_1( &tag_fn, ":fn");
tag_init_ident(&tag_ident, ident);
- tag_init_1( &tag_is_a, ":is_a");
- tag_init_1( &tag_macro, ":macro");
+ tag_init_1( &tag_is_a, ":is_a");
+ tag_init_1( &tag_macro, ":macro");
+ tag_init_sym( &tag_module, module);
tag_init_1( &tag_special_operator, ":special_operator");
tag_init_sym( &tag_sym, ident->sym);
- tag_init_sym( &tag_module, module);
- tag_init_1( &tag_symbol, ":symbol");
+ tag_init_1( &tag_symbol, ":symbol");
+ tag_init_1( &tag_symbol_value, ":symbol_value");
tag_init_var( &tag_var);
facts_with(facts, &cursor, (t_facts_spec) {
&tag_module,
@@ -92,43 +90,13 @@ s_tag * ident_get (const s_ident *ident, s_facts *facts, s_tag *dest)
}
facts_with_cursor_clean(&cursor);
facts_with(facts, &cursor, (t_facts_spec) {
- &tag_ident, &tag_cfn, &tag_var,
+ &tag_ident, &tag_symbol_value, &tag_var,
NULL, NULL });
- if (facts_with_cursor_next(&cursor)) {
- if (tag_var.type != TAG_CFN) {
- err_write_1("call_get: ");
- err_write_1(module->str.ptr.pchar);
- err_write_1(".");
- err_write_1(ident->sym->str.ptr.pchar);
- err_puts(" is not a C function");
- facts_with_cursor_clean(&cursor);
- return NULL;
- }
- }
- facts_with_cursor_clean(&cursor);
- if (tag_var.type == TAG_VAR) {
- facts_with(facts, &cursor, (t_facts_spec) {
- &tag_ident, &tag_fn, &tag_var,
- NULL, NULL });
- if (facts_with_cursor_next(&cursor)) {
- if (tag_var.type != TAG_FN) {
- err_write_1("call_get: ");
- err_write_1(module->str.ptr.pchar);
- err_write_1(".");
- err_write_1(ident->sym->str.ptr.pchar);
- err_puts(" is not a function");
- facts_with_cursor_clean(&cursor);
- return NULL;
- }
- facts_with_cursor_clean(&cursor);
- }
- }
- if (tag_var.type == TAG_VAR) {
- /*
- warnx("Neither fn nor cfn");
- */
+ if (! facts_with_cursor_next(&cursor)) {
+ facts_with_cursor_clean(&cursor);
return NULL;
}
+ facts_with_cursor_clean(&cursor);
facts_with(facts, &cursor, (t_facts_spec) {
&tag_ident, &tag_is_a, &tag_macro, NULL, NULL });
if (facts_with_cursor_next(&cursor)) {