Commit 21f163b114a16afc604c3433455fdc4e0ca60a20

Thomas de Grivel 2024-03-19T17:23:22

use :symbol_value instead of :fn and :cfn

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
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)) {