Commit 027210f5534e2793c8a59410e4373933b013029a

Thomas de Grivel 2024-03-29T11:45:04

wip config.subr and defmodule + def

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
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
diff --git a/.gitignore b/.gitignore
index 0bfda7b..0eb8c0b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,14 @@
 *~
 *.a
 .build/
+.build_cc_asan
+.build_cc_cov
+.build_cc_debug
+.build_cc_main
+.build_ld_asan
+.build_ld_cov
+.build_ld_debug
+.build_ld_main
 /c3-*/
 /c3-*.tar.gz
 c3c/c3c
diff --git a/.ic3_history b/.ic3_history
index af224cc..94de646 100644
--- a/.ic3_history
+++ b/.ic3_history
@@ -1,6 +1,3 @@
-dt(200)
-def dt = macro (x) do
-  quote do
     x = unquote x
 def dt = macro (x) do
   quote do
@@ -97,3 +94,6 @@ do end
 defmodule Plop do end
 quote Plop
 quote_cfn Plop
+type(voidà
+)
+type(void)
diff --git a/config.subr b/config.subr
index 6949efd..f01736f 100644
--- a/config.subr
+++ b/config.subr
@@ -17,43 +17,43 @@ cd "$(dirname "$0")"
 
 build_lib() {
     echo >> ${CONFIG_MK}
-    echo "$LIB: $OBJECTS .build/ld_main" >> ${CONFIG_MK}
-    echo "	.build/ld_main $LIB" >> ${CONFIG_MK}
+    echo "$LIB_ASAN: $OBJECTS_ASAN .build_ld_asan" >> ${CONFIG_MK}
+    echo "	./.build_ld_asan $LIB_ASAN" >> ${CONFIG_MK}
 
     echo >> ${CONFIG_MK}
-    echo "$LIB_ASAN: $OBJECTS_ASAN .build/ld_asan" >> ${CONFIG_MK}
-    echo "	.build/ld_asan $LIB_ASAN" >> ${CONFIG_MK}
+    echo "$LIB_COV: $OBJECTS_COV .build_ld_cov" >> ${CONFIG_MK}
+    echo "	./.build_ld_cov $LIB_COV" >> ${CONFIG_MK}
 
     echo >> ${CONFIG_MK}
-    echo "$LIB_COV: $OBJECTS_COV .build/ld_cov" >> ${CONFIG_MK}
-    echo "	.build/ld_cov $LIB_COV" >> ${CONFIG_MK}
+    echo "$LIB_DEBUG: $OBJECTS_DEBUG .build_ld_debug" >> ${CONFIG_MK}
+    echo "	./.build_ld_debug $LIB_DEBUG" >> ${CONFIG_MK}
 
     echo >> ${CONFIG_MK}
-    echo "$LIB_DEBUG: $OBJECTS_DEBUG .build/ld_debug" >> ${CONFIG_MK}
-    echo "	.build/ld_debug $LIB_DEBUG" >> ${CONFIG_MK}
+    echo "$LIB: $OBJECTS .build_ld_main" >> ${CONFIG_MK}
+    echo "	./.build_ld_main $LIB" >> ${CONFIG_MK}
 }
 
 build_lo() {
     for SRC in $SOURCES; do
         echo >> ${CONFIG_MK}
         SRC_ASAN_LO="$(c2ext .asan.lo "$SRC")"
-        c_ext_rule .asan.lo "$SRC" .build/cc_asan >> ${CONFIG_MK}
-        echo "	.build/cc_asan $SRC $SRC_ASAN_LO" >> ${CONFIG_MK}
+        c_ext_rule .asan.lo "$SRC" .build_cc_asan >> ${CONFIG_MK}
+        echo "	./.build_cc_asan $SRC $SRC_ASAN_LO" >> ${CONFIG_MK}
 
         echo >> ${CONFIG_MK}
         SRC_COV_LO="$(c2ext .cov.lo "$SRC")"
-        c_ext_rule .cov.lo "$SRC" .build/cc_cov >> ${CONFIG_MK}
-        echo "	.build/cc_cov $SRC $SRC_COV_LO" >> ${CONFIG_MK}
+        c_ext_rule .cov.lo "$SRC" .build_cc_cov >> ${CONFIG_MK}
+        echo "	./.build_cc_cov $SRC $SRC_COV_LO" >> ${CONFIG_MK}
 
         echo >> ${CONFIG_MK}
         SRC_DEBUG_LO="$(c2ext .debug.lo "$SRC")"
-        c_ext_rule .debug.lo "$SRC" .build/cc_debug >> ${CONFIG_MK}
-        echo "	.build/cc_debug $SRC $SRC_DEBUG_LO" >> ${CONFIG_MK}
+        c_ext_rule .debug.lo "$SRC" .build_cc_debug >> ${CONFIG_MK}
+        echo "	./.build_cc_debug $SRC $SRC_DEBUG_LO" >> ${CONFIG_MK}
 
         echo >> ${CONFIG_MK}
         SRC_LO="$(c2ext .main.lo "$SRC")"
-        c_ext_rule .main.lo "$SRC" .build/cc_main >> ${CONFIG_MK}
-        echo "	.build/cc_main $SRC $SRC_LO" >> ${CONFIG_MK}
+        c_ext_rule .main.lo "$SRC" .build_cc_main >> ${CONFIG_MK}
+        echo "	./.build_cc_main $SRC $SRC_LO" >> ${CONFIG_MK}
     done
 }
 
@@ -61,47 +61,45 @@ build_lo_objc() {
     for SRC in $OBJC_SOURCES; do
         echo >> ${CONFIG_MK}
         SRC_LO="$(objc2ext .main.lo "$SRC")"
-        objc_ext_rule .main.lo "$SRC" .build/objcc_main >> ${CONFIG_MK}
-        echo "	.build/objcc_main $SRC $SRC_LO" >> ${CONFIG_MK}
+        objc_ext_rule .main.lo "$SRC" .build_objcc_main >> ${CONFIG_MK}
+        echo "	./.build_objcc_main $SRC $SRC_LO" >> ${CONFIG_MK}
 
         echo >> ${CONFIG_MK}
         SRC_LO="$(objc2ext .asan.lo "$SRC")"
-        objc_ext_rule .asan.lo "$SRC" .build/objcc_asan >> ${CONFIG_MK}
-        echo "	.build/objcc_asan $SRC $SRC_LO" >> ${CONFIG_MK}
+        objc_ext_rule .asan.lo "$SRC" .build_objcc_asan >> ${CONFIG_MK}
+        echo "	./.build_objcc_asan $SRC $SRC_LO" >> ${CONFIG_MK}
 
         echo >> ${CONFIG_MK}
         SRC_LO="$(objc2ext .cov.lo "$SRC")"
-        objc_ext_rule .cov.lo "$SRC" .build/objcc_cov >> ${CONFIG_MK}
-        echo "	.build/objcc_cov $SRC $SRC_LO" >> ${CONFIG_MK}
+        objc_ext_rule .cov.lo "$SRC" .build_objcc_cov >> ${CONFIG_MK}
+        echo "	./.build_objcc_cov $SRC $SRC_LO" >> ${CONFIG_MK}
 
         echo >> ${CONFIG_MK}
         SRC_LO="$(objc2ext .debug.lo "$SRC")"
-        objc_ext_rule .debug.lo "$SRC" .build/objcc_debug >> ${CONFIG_MK}
-        echo "	.build/objcc_debug $SRC $SRC_LO" >> ${CONFIG_MK}
+        objc_ext_rule .debug.lo "$SRC" .build_objcc_debug >> ${CONFIG_MK}
+        echo "	./.build_objcc_debug $SRC $SRC_LO" >> ${CONFIG_MK}
     done
 }
 
 build_prog() {
     echo >> ${CONFIG_MK}
-    echo "$PROG_ASAN: $LOCAL_LIBS_ASAN $OBJECTS_ASAN .build/ld_asan" \
+    echo "$PROG_ASAN: $LOCAL_LIBS_ASAN $OBJECTS_ASAN .build_ld_asan" \
          >> ${CONFIG_MK}
-    echo "	.build/ld_asan $PROG_ASAN" >> ${CONFIG_MK}
+    echo "	./.build_ld_asan $PROG_ASAN" >> ${CONFIG_MK}
 
-    if $HAVE_GCOV; then
-        echo >> ${CONFIG_MK}
-        echo "$PROG_COV: $LOCAL_LIBS_COV $OBJECTS_COV .build/ld_cov" \
-             >> ${CONFIG_MK}
-        echo "	.build/ld_cov $PROG_COV" >> ${CONFIG_MK}
-    fi
+    echo >> ${CONFIG_MK}
+    echo "$PROG_COV: $LOCAL_LIBS_COV $OBJECTS_COV .build_ld_cov" \
+         >> ${CONFIG_MK}
+    echo "	./.build_ld_cov $PROG_COV" >> ${CONFIG_MK}
 
     echo >> ${CONFIG_MK}
-    echo "$PROG_DEBUG: $LOCAL_LIBS_DEBUG $OBJECTS_DEBUG .build/ld_debug" \
+    echo "$PROG_DEBUG: $LOCAL_LIBS_DEBUG $OBJECTS_DEBUG .build_ld_debug" \
          >> ${CONFIG_MK}
-    echo "	.build/ld_debug $PROG_DEBUG" >> ${CONFIG_MK}
+    echo "	./.build_ld_debug $PROG_DEBUG" >> ${CONFIG_MK}
 
     echo >> ${CONFIG_MK}
-    echo "$PROG: $LOCAL_LIBS $OBJECTS .build/ld_main" >> ${CONFIG_MK}
-    echo "	.build/ld_main $PROG" >> ${CONFIG_MK}
+    echo "$PROG: $LOCAL_LIBS $OBJECTS .build_ld_main" >> ${CONFIG_MK}
+    echo "	./.build_ld_main $PROG" >> ${CONFIG_MK}
 }
 
 c_o_rule() {
@@ -440,10 +438,10 @@ update_and_chmod() {
 }
 
 update_build() {
-    CC_MAIN=.build/cc_main.tmp
-    CC_ASAN=.build/cc_asan.tmp
-    CC_COV=.build/cc_cov.tmp
-    CC_DEBUG=.build/cc_debug.tmp
+    CC_MAIN=.build_cc_main.tmp
+    CC_ASAN=.build_cc_asan.tmp
+    CC_COV=.build_cc_cov.tmp
+    CC_DEBUG=.build_cc_debug.tmp
     mkdir -p .build
 
     COMPILE="${LIBTOOL} --tag=CC --mode=compile"
@@ -457,7 +455,7 @@ update_build() {
     echo "CPPFLAGS=\"${CPPFLAGS_ASAN}\"" >> ${CC_ASAN}
     echo "CFLAGS=\"${CFLAGS_ASAN}\"" >> ${CC_ASAN}
     echo "$COMPILE > \"\$LOG\" 2>&1 || $COMPILE" >> ${CC_ASAN}
-    update_and_chmod 755 ${CC_ASAN} .build/cc_asan
+    update_and_chmod 755 ${CC_ASAN} .build_cc_asan
 
     echo "#!/bin/sh" >> ${CC_COV}
     echo "# gen by configure" >> ${CC_COV}
@@ -466,7 +464,7 @@ update_build() {
     echo "CPPFLAGS=\"${CPPFLAGS_COV}\"" >> ${CC_COV}
     echo "CFLAGS=\"${CFLAGS_COV}\"" >> ${CC_COV}
     echo "$COMPILE > \"\$LOG\" 2>&1 || $COMPILE" >> ${CC_COV}
-    update_and_chmod 755 ${CC_COV} .build/cc_cov
+    update_and_chmod 755 ${CC_COV} .build_cc_cov
 
     echo "#!/bin/sh" >> ${CC_DEBUG}
     echo "# gen by configure" >> ${CC_DEBUG}
@@ -475,7 +473,7 @@ update_build() {
     echo "CPPFLAGS=\"${CPPFLAGS_DEBUG}\"" >> ${CC_DEBUG}
     echo "CFLAGS=\"${CFLAGS_DEBUG}\"" >> ${CC_DEBUG}
     echo "$COMPILE > \"\$LOG\" 2>&1 || $COMPILE" >> ${CC_DEBUG}
-    update_and_chmod 755 ${CC_DEBUG} .build/cc_debug
+    update_and_chmod 755 ${CC_DEBUG} .build_cc_debug
 
     echo "#!/bin/sh" >> ${CC_MAIN}
     echo "# gen by configure" >> ${CC_MAIN}
@@ -484,70 +482,74 @@ update_build() {
     echo "CPPFLAGS=\"${CPPFLAGS}\"" >> ${CC_MAIN}
     echo "CFLAGS=\"${CFLAGS}\"" >> ${CC_MAIN}
     echo "$COMPILE > \"\$LOG\" 2>&1 || $COMPILE" >> ${CC_MAIN}
-    update_and_chmod 755 ${CC_MAIN} .build/cc_main
+    update_and_chmod 755 ${CC_MAIN} .build_cc_main
 }
 
 update_build_lib() {
-    LD_MAIN=.build/ld_main.tmp
-    LD_ASAN=.build/ld_asan.tmp
-    LD_COV=.build/ld_cov.tmp
-    LD_DEBUG=.build/ld_debug.tmp
+    LD_MAIN=.build_ld_main.tmp
+    LD_ASAN=.build_ld_asan.tmp
+    LD_COV=.build_ld_cov.tmp
+    LD_DEBUG=.build_ld_debug.tmp
     mkdir -p .build
 
-    LINK="${LIBTOOL} --tag=CC --mode=link"
-    LINK="$LINK \${CC} -shared \${LDFLAGS} \${OBJECTS} \${LIBS}"
-    LINK="$LINK -rpath ${LIBDIR} -o \"\$1\""
+    LINK="${LIBTOOL} --tag=CC --mode=link "
+    LINK="$LINK \${CC} -shared \${CFLAGS} \${LDFLAGS}"
+    LINK="$LINK \${OBJECTS} \${LIBS} -rpath ${LIBDIR} -o \"\$1\""
 
     echo "#!/bin/sh" >> ${LD_ASAN}
     echo "# gen by configure" >> ${LD_ASAN}
     echo "LOG=\".build/\$1.asan.log\"" >> ${LD_ASAN}
     echo "CC=\"${CC}\"" >> ${LD_ASAN}
+    echo "CFLAGS=\"${CFLAGS_ASAN}\"" >> ${LD_ASAN}
     echo "LDFLAGS=\"${LDFLAGS_ASAN}\"" >> ${LD_ASAN}
     echo "OBJECTS=\"${OBJECTS_ASAN}\"" >> ${LD_ASAN}
     echo "LIBS=\"${LIBS_ASAN}\"" >> ${LD_ASAN}
     echo >> ${LD_ASAN}
     echo "$LINK > \"\$LOG\" 2>&1 || $LINK" >> ${LD_ASAN}
-    update_and_chmod 755 ${LD_ASAN} .build/ld_asan
+    update_and_chmod 755 ${LD_ASAN} .build_ld_asan
 
     echo "#!/bin/sh" >> ${LD_COV}
     echo "# gen by configure" >> ${LD_COV}
     echo "LOG=\".build/\$1.cov.log\"" >> ${LD_COV}
     echo "CC=\"${CC}\"" >> ${LD_COV}
+    echo "CFLAGS=\"${CFLAGS_COV}\"" >> ${LD_COV}
     echo "LDFLAGS=\"${LDFLAGS_COV}\"" >> ${LD_COV}
     echo "OBJECTS=\"${OBJECTS_COV}\"" >> ${LD_COV}
     echo "LIBS=\"${LIBS_COV}\"" >> ${LD_COV}
     echo >> ${LD_COV}
     echo "$LINK > \"\$LOG\" 2>&1 || $LINK" >> ${LD_COV}
-    update_and_chmod 755 ${LD_COV} .build/ld_cov
+    update_and_chmod 755 ${LD_COV} .build_ld_cov
 
     echo "#!/bin/sh" >> ${LD_DEBUG}
     echo "# gen by configure" >> ${LD_DEBUG}
     echo "LOG=\".build/\$1.debug.log\"" >> ${LD_DEBUG}
     echo "CC=\"${CC}\"" >> ${LD_DEBUG}
+    echo "CFLAGS=\"${CFLAGS_DEBUG}\"" >> ${LD_DEBUG}
     echo "LDFLAGS=\"${LDFLAGS_DEBUG}\"" >> ${LD_DEBUG}
     echo "OBJECTS=\"${OBJECTS_DEBUG}\"" >> ${LD_DEBUG}
     echo "LIBS=\"${LIBS_DEBUG}\"" >> ${LD_DEBUG}
     echo >> ${LD_DEBUG}
     echo "$LINK > \"\$LOG\" 2>&1 || $LINK" >> ${LD_DEBUG}
-    update_and_chmod 755 ${LD_DEBUG} .build/ld_debug
+    update_and_chmod 755 ${LD_DEBUG} .build_ld_debug
 
     echo "#!/bin/sh" >> ${LD_MAIN}
     echo "# gen by configure" >> ${LD_MAIN}
     echo "LOG=\".build/\$1.main.log\"" >> ${LD_MAIN}
     echo "CC=\"${CC}\"" >> ${LD_MAIN}
+    echo "CFLAGS=\"${CFLAGS}\"" >> ${LD_MAIN}
     echo "LDFLAGS=\"${LDFLAGS}\"" >> ${LD_MAIN}
     echo "OBJECTS=\"${OBJECTS}\"" >> ${LD_MAIN}
     echo "LIBS=\"${LIBS}\"" >> ${LD_MAIN}
     echo >> ${LD_MAIN}
     echo "$LINK > \"\$LOG\" 2>&1 || $LINK" >> ${LD_MAIN}
-    update_and_chmod 755 ${LD_MAIN} .build/ld_main
+    update_and_chmod 755 ${LD_MAIN} .build_ld_main
 }
 
 update_build_objc() {
-    OBJCC_MAIN=.build/objcc_main.tmp
-    OBJCC_ASAN=.build/objcc_asan.tmp
-    OBJCC_COV=.build/objcc_cov.tmp
-    OBJCC_DEBUG=.build/objcc_debug.tmp
+    OBJCC_MAIN=.build_objcc_main.tmp
+    OBJCC_ASAN=.build_objcc_asan.tmp
+    OBJCC_COV=.build_objcc_cov.tmp
+    OBJCC_DEBUG=.build_objcc_debug.tmp
     mkdir -p .build
 
     echo "#!/bin/sh" >> ${OBJCC_ASAN}
@@ -556,7 +558,7 @@ update_build_objc() {
     echo "CPPFLAGS=\"${CPPFLAGS_ASAN}\"" >> ${OBJCC_ASAN}
     echo "CFLAGS=\"${CFLAGS_ASAN}\"" >> ${OBJCC_ASAN}
     echo "${LIBTOOL} --tag=CC --mode=compile \${OBJCC} \${CPPFLAGS} \${CFLAGS} -c \"\$1\" -o \"\$2\" >> .build/log 2>&1" >> ${OBJCC_ASAN}
-    update_and_chmod 755 ${OBJCC_ASAN} .build/objcc_asan
+    update_and_chmod 755 ${OBJCC_ASAN} .build_objcc_asan
 
     echo "#!/bin/sh" >> ${OBJCC_COV}
     echo "# gen by configure" >> ${OBJCC_COV}
@@ -564,7 +566,7 @@ update_build_objc() {
     echo "CPPFLAGS=\"${CPPFLAGS_COV}\"" >> ${OBJCC_COV}
     echo "CFLAGS=\"${CFLAGS_COV}\"" >> ${OBJCC_COV}
     echo "${LIBTOOL} --tag=CC --mode=compile \${OBJCC} \${CPPFLAGS} \${CFLAGS} -c \"\$1\" -o \"\$2\" >> .build/log 2>&1" >> ${OBJCC_COV}
-    update_and_chmod 755 ${OBJCC_COV} .build/objcc_cov
+    update_and_chmod 755 ${OBJCC_COV} .build_objcc_cov
 
     echo "#!/bin/sh" >> ${OBJCC_DEBUG}
     echo "# gen by configure" >> ${OBJCC_DEBUG}
@@ -572,7 +574,7 @@ update_build_objc() {
     echo "CPPFLAGS=\"${CPPFLAGS_DEBUG}\"" >> ${OBJCC_DEBUG}
     echo "CFLAGS=\"${CFLAGS_DEBUG}\"" >> ${OBJCC_DEBUG}
     echo "${LIBTOOL} --tag=CC --mode=compile \${OBJCC} \${CPPFLAGS} \${CFLAGS} -c \"\$1\" -o \"\$2\" >> .build/log 2>&1" >> ${OBJCC_DEBUG}
-    update_and_chmod 755 ${OBJCC_DEBUG} .build/objcc_debug
+    update_and_chmod 755 ${OBJCC_DEBUG} .build_objcc_debug
 
     echo "#!/bin/sh" >> ${OBJCC_MAIN}
     echo "# gen by configure" >> ${OBJCC_MAIN}
@@ -580,14 +582,14 @@ update_build_objc() {
     echo "CPPFLAGS=\"${CPPFLAGS}\"" >> ${OBJCC_MAIN}
     echo "CFLAGS=\"${CFLAGS}\"" >> ${OBJCC_MAIN}
     echo "${LIBTOOL} --tag=CC --mode=compile \${OBJCC} \${CPPFLAGS} \${CFLAGS} -c \"\$1\" -o \"\$2\" >> .build/log 2>&1" >> ${OBJCC_MAIN}
-    update_and_chmod 755 ${OBJCC_MAIN} .build/objcc_main
+    update_and_chmod 755 ${OBJCC_MAIN} .build_objcc_main
 }
 
 update_build_prog() {
-    LD_MAIN=.build/ld_main.tmp
-    LD_ASAN=.build/ld_asan.tmp
-    LD_COV=.build/ld_cov.tmp
-    LD_DEBUG=.build/ld_debug.tmp
+    LD_MAIN=.build_ld_main.tmp
+    LD_ASAN=.build_ld_asan.tmp
+    LD_COV=.build_ld_cov.tmp
+    LD_DEBUG=.build_ld_debug.tmp
     mkdir -p .build
 
     LINK="${LIBTOOL} --tag=CC --mode=link"
@@ -604,7 +606,7 @@ update_build_prog() {
     echo "LIBS=\"${LIBS_ASAN}\"" >> ${LD_ASAN}
     echo >> ${LD_ASAN}
     echo "$LINK > \"\$LOG\" 2>&1 || $LINK" >> ${LD_ASAN}
-    update_and_chmod 755 ${LD_ASAN} .build/ld_asan
+    update_and_chmod 755 ${LD_ASAN} .build_ld_asan
 
     echo "#!/bin/sh" >> ${LD_COV}
     echo "# gen by configure" >> ${LD_COV}
@@ -616,7 +618,7 @@ update_build_prog() {
     echo "LIBS=\"${LIBS_COV}\"" >> ${LD_COV}
     echo >> ${LD_COV}
     echo "$LINK > \"\$LOG\" 2>&1 || $LINK" >> ${LD_COV}
-    update_and_chmod 755 ${LD_COV} .build/ld_cov
+    update_and_chmod 755 ${LD_COV} .build_ld_cov
 
     echo "#!/bin/sh" >> ${LD_DEBUG}
     echo "# gen by configure" >> ${LD_DEBUG}
@@ -628,7 +630,7 @@ update_build_prog() {
     echo "LIBS=\"${LIBS_DEBUG}\"" >> ${LD_DEBUG}
     echo >> ${LD_DEBUG}
     echo "$LINK > \"\$LOG\" 2>&1 || $LINK" >> ${LD_DEBUG}
-    update_and_chmod 755 ${LD_DEBUG} .build/ld_debug
+    update_and_chmod 755 ${LD_DEBUG} .build_ld_debug
 
     echo "#!/bin/sh" >> ${LD_MAIN}
     echo "# gen by configure" >> ${LD_MAIN}
@@ -640,7 +642,7 @@ update_build_prog() {
     echo "LIBS=\"${LIBS}\"" >> ${LD_MAIN}
     echo >> ${LD_MAIN}
     echo "$LINK > \"\$LOG\" 2>&1 || $LINK" >> ${LD_MAIN}
-    update_and_chmod 755 ${LD_MAIN} .build/ld_main
+    update_and_chmod 755 ${LD_MAIN} .build_ld_main
 }
 
 update_file() {
diff --git a/ic3/.ic3_history b/ic3/.ic3_history
index d046941..1755c4b 100644
--- a/ic3/.ic3_history
+++ b/ic3/.ic3_history
@@ -1,4 +1,3 @@
-    x = unquote x
 def dt = macro (x) do
   quote do
     x = unquote(x)
@@ -97,3 +96,4 @@ quote_cfn Plop
 (Sym) "Abc"
 defmodule Plop do end
 defmodule Plop do def a = 1 end
+quote_cfn Plop
diff --git a/libc3/c3.c b/libc3/c3.c
index ba65158..62ac697 100644
--- a/libc3/c3.c
+++ b/libc3/c3.c
@@ -50,8 +50,7 @@ s_tag * c3_def (const s_call *call, s_tag *dest)
   return env_def(&g_c3_env, call, dest);
 }
 
-const s_sym ** c3_defmodule (const s_sym **name, const s_block *block,
-                             const s_sym **dest)
+s_tag * c3_defmodule (const s_sym **name, const s_block *block, s_tag *dest)
 {
   return env_defmodule(&g_c3_env, name, block, dest);
 }
@@ -77,9 +76,10 @@ uw * c3_facts_next_id (uw *dest)
   return dest;
 }
 
-s_tag * c3_quote_cfn (const s_sym *sym, s_tag *dest)
+s_tag * c3_quote_cfn (const s_sym **sym, s_tag *dest)
 {
-  return tag_init_sym(dest, sym);
+  assert(sym);
+  return tag_init_sym(dest, *sym);
 }
 
 s_str * c3_getenv (const s_str *name, s_str *dest)
diff --git a/libc3/c3_main.h b/libc3/c3_main.h
index f78bd1d..357db11 100644
--- a/libc3/c3_main.h
+++ b/libc3/c3_main.h
@@ -35,12 +35,11 @@ s_str * c3_getenv (const s_str *name, s_str *dest);
 void    c3_license (void);
 
 /* Operators. */
-s_tag *        c3_def (const s_call *call, s_tag *dest);
-const s_sym ** c3_defmodule (const s_sym **name, const s_block *block,
-                             const s_sym **dest);
-void **        c3_dlopen (const s_str *path, void **dest);
-void           c3_exit (sw code);
-s_tag *        c3_pin (const s_tag *a, s_tag *dest);
+s_tag * c3_def (const s_call *call, s_tag *dest);
+s_tag * c3_defmodule (const s_sym **name, const s_block *block, s_tag *dest);
+void ** c3_dlopen (const s_str *path, void **dest);
+void    c3_exit (sw code);
+s_tag * c3_pin (const s_tag *a, s_tag *dest);
 
 /* Special operators. */
 s_tag * c3_if_then_else (const s_tag *cond, const s_tag *then,
diff --git a/libc3/cfn.c b/libc3/cfn.c
index 3b75c88..7ada8fa 100644
--- a/libc3/cfn.c
+++ b/libc3/cfn.c
@@ -26,6 +26,7 @@ static s_tag * cfn_tag_init (s_tag *tag, const s_sym *type);
 s_tag * cfn_apply (s_cfn *cfn, s_list *args, s_tag *dest)
 {
   s_list *a;
+  void **arg_pointer_result = NULL;
   void **arg_pointers = NULL;
   void **arg_values = NULL;
   void **result_pointer = NULL;
@@ -75,15 +76,12 @@ s_tag * cfn_apply (s_cfn *cfn, s_list *args, s_tag *dest)
     while (cfn_arg_types) {
       assert(cfn_arg_types->tag.type == TAG_SYM);
       if (cfn_arg_types->tag.data.sym == &g_sym_Result) {
+        assert(cfn->cif.rtype == &ffi_type_pointer);
         cfn_tag_init(&tmp2, cfn->result_type);
-        if (cfn->cif.rtype == &ffi_type_pointer) {
-          if (! tag_to_ffi_pointer(&tmp2, cfn->result_type, arg_pointers + i))
-            goto ko;
-          arg_values[i] = &arg_pointers[i];
-        }
-        else
-          if (! tag_to_ffi_pointer(&tmp2, cfn->result_type, arg_values + i))
-            goto ko;
+        if (! tag_to_ffi_pointer(&tmp2, cfn->result_type, arg_pointers + i))
+          goto ko;
+        arg_values[i] = &arg_pointers[i];
+        arg_pointer_result = arg_pointers[i];
       }
       else {
         if (cfn->cif.arg_types[i] == &ffi_type_pointer) {
@@ -105,6 +103,17 @@ s_tag * cfn_apply (s_cfn *cfn, s_list *args, s_tag *dest)
   if (cfn->ptr.f) {
     ffi_call(&cfn->cif, cfn->ptr.f, result, arg_values);
     if (cfn->arg_result) {
+      if (result_pointer != arg_pointer_result) {
+        err_write_1("cfn_apply: ");
+        err_inspect_str(&cfn->name->str);
+        err_write_1(": ");
+        err_inspect_ptr(result_pointer);
+        err_write_1(": ");
+        err_inspect_ptr(arg_pointer_result);
+        err_write_1("\n");
+        assert(! "cfn_apply: error");
+        goto ko;
+      }
       *dest = tmp2;
     }
     else
diff --git a/libc3/env.c b/libc3/env.c
index c8e92e0..dd7ff02 100644
--- a/libc3/env.c
+++ b/libc3/env.c
@@ -89,8 +89,9 @@ s_tag * env_def (s_env *env, const s_call *call, s_tag *dest)
     assert(! "env_def: invalid assignment: expected Ident = value");
     return NULL;
   }
-  tag_init_ident(&tag_ident, &call->arguments->tag.data.ident);
-  env_ident_resolve_module(env, &tag_ident.data.ident);
+  tag_ident.type = TAG_IDENT;
+  env_ident_resolve_module(env, &call->arguments->tag.data.ident,
+                           &tag_ident.data.ident);
   tag_init_sym(&tag_module, tag_ident.data.ident.module);
   tag_init_sym(&tag_symbol, &g_sym_symbol);
   tag_init_sym(&tag_symbol_value, &g_sym_symbol_value);
@@ -106,11 +107,11 @@ s_tag * env_def (s_env *env, const s_call *call, s_tag *dest)
   return dest;
 }
 
-const s_sym ** env_defmodule (s_env *env, const s_sym **name,
-                              const s_block *block, const s_sym **dest)
+s_tag * env_defmodule (s_env *env, const s_sym **name,
+                       const s_block *block, s_tag *dest)
 {
   const s_sym *module;
-  const s_sym **result = NULL;
+  s_tag *result = NULL;
   s_tag tmp = {0};
   assert(env);
   assert(name);
@@ -121,12 +122,12 @@ const s_sym ** env_defmodule (s_env *env, const s_sym **name,
   env_module_is_loading_set(env, *name, true);
   env->current_module = *name;
   if (env_eval_block(env, block, &tmp)) {
-    *dest = *name;
+    tag_clean(&tmp);
+    tag_init_sym(dest, *name);
     result = dest;
   }
   env->current_module = module;
   env_module_is_loading_set(env, *name, false);
-  tag_clean(&tmp);
   return result;
 }
 
@@ -330,10 +331,12 @@ bool env_eval_call_fn (s_env *env, const s_call *call, s_tag *dest)
 
 bool env_eval_call_resolve (s_env *env, s_call *call)
 {
+  s_ident tmp_ident;
   const s_tag *value;
   assert(env);
   assert(call);
-  if ((value = env_frames_get(env, call->ident.sym))) {
+  if (call->ident.module == NULL &&
+      (value = env_frames_get(env, call->ident.sym))) {
     if (value->type == TAG_CFN) {
       call->cfn = cfn_new_copy(&value->data.cfn);
       return true;
@@ -343,11 +346,12 @@ bool env_eval_call_resolve (s_env *env, s_call *call)
       return true;
     }
   }
-  if (! ident_resolve_module(&call->ident, env))
+  ident_init_copy(&tmp_ident, &call->ident);
+  if (! env_ident_resolve_module(env, &tmp_ident, &call->ident) ||
+      ! module_ensure_loaded(call->ident.module, &env->facts) ||
+      ! call_get(call, &env->facts))
     return false;
-  if (! module_ensure_loaded(call->ident.module, &env->facts))
-    return false;
-  return call_get(call, &env->facts);
+  return true;
 }
 
 bool env_eval_complex (s_env *env, const s_complex *c, s_tag *dest)
@@ -739,8 +743,7 @@ bool env_eval_ident (s_env *env, const s_ident *ident, s_tag *dest)
   s_ident tmp_ident;
   assert(env);
   assert(ident);
-  ident_init_copy(&tmp_ident, ident);
-  ident_resolve_module(&tmp_ident, env);
+  env_ident_resolve_module(env, ident, &tmp_ident);
   if (! ((tag = env_frames_get(env, tmp_ident.sym)) ||
          (tag = ident_get(&tmp_ident, &env->facts, &tmp)))) {
     err_write_1("env_eval_ident: unbound ident: ");
@@ -760,8 +763,7 @@ bool env_eval_ident_is_bound (s_env *env, const s_ident *ident)
   assert(ident);
   if (env_frames_get(env, ident->sym))
     return true;
-  ident_init_copy(&tmp_ident, ident);
-  ident_resolve_module(&tmp_ident, env);
+  env_ident_resolve_module(env, ident, &tmp_ident);
   if (ident_get(&tmp_ident, &env->facts, &tmp)) {
     tag_clean(&tmp);
     return true;
@@ -1324,8 +1326,8 @@ bool env_ident_is_special_operator (s_env *env,
   s_tag tag_special_operator;
   assert(env);
   assert(ident);
-  tag_init_ident(&tag_ident, ident);
-  env_ident_resolve_module(env, &tag_ident.data.ident);
+  tag_ident.type = TAG_IDENT;
+  env_ident_resolve_module(env, ident, &tag_ident.data.ident);
   tag_init_sym(&tag_is_a, &g_sym_is_a);
   tag_init_sym(&tag_special_operator, &g_sym_special_operator);
   if (facts_find_fact_by_tags(&env->facts, &tag_ident, &tag_is_a,
@@ -1334,19 +1336,24 @@ bool env_ident_is_special_operator (s_env *env,
   return false;
 }
 
-bool env_ident_resolve_module (const s_env *env, const s_ident *ident,
-                               s_ident *dest)
+s_ident * env_ident_resolve_module (const s_env *env,
+                                    const s_ident *ident,
+                                    s_ident *dest)
 {
+  s_ident tmp;
   assert(env);
   assert(ident);
-  if (! ident->module) {
+  ident_init_copy(&tmp, ident);
+  if (! tmp.module) {
     if (! env->current_module) {
       err_puts("env_ident_resolve_module: env current module is NULL");
       assert(! "env_ident_resolve_module: env current module is NULL");
-      return false;
+      return NULL;
     }
-    ident->module = env->current_module;
+    tmp.module = env->current_module;
   }
+  *dest = tmp;
+  return dest;
 }
 
 s_env * env_init (s_env *env, int argc, char **argv)
@@ -1663,8 +1670,7 @@ s_ident * env_operator_resolve (s_env *env, const s_ident *op,
   s_tag tag_sym;
   s_tag tag_symbol;
   s_ident tmp;
-  tmp = *op;
-  ident_resolve_module(&tmp, env);
+  env_ident_resolve_module(env, op, &tmp);
   tag_init_sym(&tag_arity, &g_sym_arity);
   tag_init_u8( &tag_arity_u8, arity);
   tag_init_sym(&tag_is_a, &g_sym_is_a);
@@ -1754,8 +1760,8 @@ u8 env_special_operator_arity (s_env *env, const s_ident *ident)
   s_tag tag_var;
   assert(env);
   assert(ident);
-  tag_init_ident(&tag_ident, ident);
-  env_ident_resolve_module(env, &tag_ident.data.ident);
+  tag_ident.type = TAG_IDENT;
+  env_ident_resolve_module(env, ident, &tag_ident.data.ident);
   tag_init_sym(  &tag_arity, &g_sym_arity);
   tag_init_var(  &tag_var);
   facts_with_tags(&env->facts, &cursor,
diff --git a/libc3/env.h b/libc3/env.h
index 7fa3e3c..992c616 100644
--- a/libc3/env.h
+++ b/libc3/env.h
@@ -23,125 +23,126 @@ s_env * env_init (s_env *env, int argc, char **argv);
 
 /* Observers. */
 const s_tag * env_frames_get (const s_env *env, const s_sym *name);
-void          env_ident_resolve_module (const s_env *env,
-                                        s_ident *ident);
+s_ident *     env_ident_resolve_module (const s_env *env,
+                                        const s_ident *ident,
+                                        s_ident *dest);
 
 /* Operators. */
-s_tag *        env_def (s_env *env, const s_call *call, s_tag *dest);
-const s_sym ** env_defmodule (s_env *env, const s_sym **name,
-                              const s_block *block, const s_sym **dest);
-bool           env_eval_array (s_env *env, const s_array *array,
-                               s_array *dest);
-bool           env_eval_array_tag (s_env *env, const s_array *array,
-                                   s_tag *dest);
-bool           env_eval_block (s_env *env, const s_block *block,
-                               s_tag *dest);
-bool           env_eval_call (s_env *env, const s_call *call,
-                              s_tag *dest);
-bool           env_eval_call_arguments (s_env *env, const s_list *args,
-                                        s_list **dest);
-bool           env_eval_call_cfn (s_env *env, const s_call *call,
+s_tag *       env_def (s_env *env, const s_call *call, s_tag *dest);
+s_tag *       env_defmodule (s_env *env, const s_sym **name,
+                             const s_block *block, s_tag *dest);
+bool          env_eval_array (s_env *env, const s_array *array,
+                              s_array *dest);
+bool          env_eval_array_tag (s_env *env, const s_array *array,
                                   s_tag *dest);
-bool           env_eval_call_fn (s_env *env, const s_call *call,
-                                 s_tag *dest);
-bool           env_eval_call_resolve (s_env *env, s_call *call);
-bool           env_eval_complex (s_env *env, const s_complex *c,
+bool          env_eval_block (s_env *env, const s_block *block,
+                              s_tag *dest);
+bool          env_eval_call (s_env *env, const s_call *call,
+                             s_tag *dest);
+bool          env_eval_call_arguments (s_env *env, const s_list *args,
+                                       s_list **dest);
+bool          env_eval_call_cfn (s_env *env, const s_call *call,
                                  s_tag *dest);
-bool           env_eval_equal_block (s_env *env, bool macro,
-                                     const s_block *a, const s_block *b,
-                                     s_block *dest);
-bool           env_eval_equal_list (s_env *env, bool macro,
-                                    const s_list *a, const s_list *b,
-                                    s_list **dest);
-bool           env_eval_equal_struct (s_env *env, bool macro,
-                                      const s_struct *a,
-                                      const s_struct *b,
-                                      s_struct *dest);
-bool           env_eval_equal_tag (s_env *env, bool macro,
-                                   const s_tag *a, const s_tag *b,
-                                   s_tag *dest);
-bool           env_eval_equal_tuple (s_env *env, bool macro,
-                                     const s_tuple *a, const s_tuple *b,
-                                     s_tuple *dest);
-bool           env_eval_fn (s_env *env, const s_fn *fn, s_tag *dest);
-bool           env_eval_fn_call (s_env *env, const s_fn *fn,
-                                 const s_list *arguments, s_tag *dest);
-bool           env_eval_ident (s_env *env, const s_ident *ident,
-                               s_tag *dest);
-bool           env_eval_ident_is_bound (s_env *env,
-                                        const s_ident *ident);
-bool           env_eval_list (s_env *env, const s_list *list,
+bool          env_eval_call_fn (s_env *env, const s_call *call,
+                                s_tag *dest);
+bool          env_eval_call_resolve (s_env *env, s_call *call);
+bool          env_eval_complex (s_env *env, const s_complex *c,
+                                s_tag *dest);
+bool          env_eval_equal_block (s_env *env, bool macro,
+                                    const s_block *a, const s_block *b,
+                                    s_block *dest);
+bool          env_eval_equal_list (s_env *env, bool macro,
+                                   const s_list *a, const s_list *b,
+                                   s_list **dest);
+bool          env_eval_equal_struct (s_env *env, bool macro,
+                                     const s_struct *a,
+                                     const s_struct *b,
+                                     s_struct *dest);
+bool          env_eval_equal_tag (s_env *env, bool macro,
+                                  const s_tag *a, const s_tag *b,
+                                  s_tag *dest);
+bool          env_eval_equal_tuple (s_env *env, bool macro,
+                                    const s_tuple *a, const s_tuple *b,
+                                    s_tuple *dest);
+bool          env_eval_fn (s_env *env, const s_fn *fn, s_tag *dest);
+bool          env_eval_fn_call (s_env *env, const s_fn *fn,
+                                const s_list *arguments, s_tag *dest);
+bool          env_eval_ident (s_env *env, const s_ident *ident,
                               s_tag *dest);
-bool           env_eval_map (s_env *env, const s_map *map,
+bool          env_eval_ident_is_bound (s_env *env,
+                                       const s_ident *ident);
+bool          env_eval_list (s_env *env, const s_list *list,
                              s_tag *dest);
-bool           env_eval_progn (s_env *env, const s_list *program,
-                               s_tag *dest);
-bool           env_eval_quote (s_env *env, const s_quote *quote,
-                               s_tag *dest);
-bool           env_eval_quote_array (s_env *env, const s_array *array,
-                                     s_tag *dest);
-bool           env_eval_quote_block (s_env *env, const s_block *block,
-                                     s_tag *dest);
-bool           env_eval_quote_call (s_env *env, const s_call *call,
+bool          env_eval_map (s_env *env, const s_map *map,
+                            s_tag *dest);
+bool          env_eval_progn (s_env *env, const s_list *program,
+                              s_tag *dest);
+bool          env_eval_quote (s_env *env, const s_quote *quote,
+                              s_tag *dest);
+bool          env_eval_quote_array (s_env *env, const s_array *array,
                                     s_tag *dest);
-bool           env_eval_quote_list (s_env *env, const s_list *list,
+bool          env_eval_quote_block (s_env *env, const s_block *block,
                                     s_tag *dest);
-bool           env_eval_quote_map (s_env *env, const s_map *map,
+bool          env_eval_quote_call (s_env *env, const s_call *call,
                                    s_tag *dest);
-bool           env_eval_quote_quote (s_env *env, const s_quote *quote,
-                                     s_tag *dest);
-bool           env_eval_quote_struct (s_env *env, const s_struct *s,
-                                      s_tag *dest);
-bool           env_eval_quote_tag (s_env *env, const s_tag *tag,
+bool          env_eval_quote_list (s_env *env, const s_list *list,
                                    s_tag *dest);
-bool           env_eval_quote_tuple (s_env *env, const s_tuple *tuple,
+bool          env_eval_quote_map (s_env *env, const s_map *map,
+                                  s_tag *dest);
+bool          env_eval_quote_quote (s_env *env, const s_quote *quote,
+                                    s_tag *dest);
+bool          env_eval_quote_struct (s_env *env, const s_struct *s,
                                      s_tag *dest);
-bool           env_eval_quote_unquote (s_env *env,
-                                       const s_unquote *unquote,
-                                       s_tag *dest);
-bool           env_eval_struct (s_env *env, const s_struct *s,
-                                s_tag *dest);
-bool           env_eval_tag (s_env *env, const s_tag *tag,
-                             s_tag *dest);
-bool           env_eval_tuple (s_env *env, const s_tuple *tuple,
+bool          env_eval_quote_tag (s_env *env, const s_tag *tag,
+                                  s_tag *dest);
+bool          env_eval_quote_tuple (s_env *env, const s_tuple *tuple,
+                                    s_tag *dest);
+bool          env_eval_quote_unquote (s_env *env,
+                                      const s_unquote *unquote,
+                                      s_tag *dest);
+bool          env_eval_struct (s_env *env, const s_struct *s,
                                s_tag *dest);
-bool           env_eval_void (s_env *env, const void *_, s_tag *dest);
-bool           env_ident_is_special_operator (s_env *env,
-                                              const s_ident *ident);
-bool           env_module_is_loading (s_env *env, const s_sym *module);
-bool           env_module_is_loading_set (s_env *env,
-                                          const s_sym *module,
-                                          bool value);
-bool           env_module_load (s_env *env, const s_sym *module,
-                                s_facts *facts);
-bool           env_module_maybe_reload (s_env *env,
-                                        const s_sym *module,
-                                        s_facts *facts);
-s8             env_operator_arity (s_env *env, const s_ident *op);
-bool           env_operator_find (s_env *env, const s_ident *op);
-s_ident *      env_operator_ident (s_env *env, const s_ident *op,
-                                   s_ident *dest);
-bool           env_eval_integer (s_env *env, const s_integer *integer,
-                                 s_integer *dest);
-bool           env_operator_is_right_associative (s_env *env,
-                                                  const s_ident *op);
-s8             env_operator_precedence (s_env *env, const s_ident *op);
-s_ident *      env_operator_resolve (s_env *env, const s_ident *op,
-                                     u8 arity, s_ident *dest);
-const s_sym *  env_operator_symbol (s_env *env, const s_ident *op);
-u8             env_special_operator_arity (s_env *env,
-                                           const s_ident *ident);
-bool           env_struct_type_exists (s_env *env,
-                                       const s_sym *module);
-const s_struct_type *
-               env_struct_type_find (s_env *env, const s_sym *module);
-f_clean        env_struct_type_get_clean (s_env *env,
-                                          const s_sym *module);
-s_list **      env_struct_type_get_spec (s_env *env, const s_sym *module,
-                                         s_list **dest);
-bool           env_tag_ident_is_bound (const s_env *env,
-                                       const s_tag *tag,
+bool          env_eval_tag (s_env *env, const s_tag *tag,
+                            s_tag *dest);
+bool          env_eval_tuple (s_env *env, const s_tuple *tuple,
+                              s_tag *dest);
+bool          env_eval_void (s_env *env, const void *_, s_tag *dest);
+bool          env_ident_is_special_operator (s_env *env,
+                                             const s_ident *ident);
+bool          env_module_is_loading (s_env *env, const s_sym *module);
+bool          env_module_is_loading_set (s_env *env,
+                                         const s_sym *module,
+                                         bool value);
+bool          env_module_load (s_env *env, const s_sym *module,
+                               s_facts *facts);
+bool          env_module_maybe_reload (s_env *env,
+                                       const s_sym *module,
                                        s_facts *facts);
+s8            env_operator_arity (s_env *env, const s_ident *op);
+bool          env_operator_find (s_env *env, const s_ident *op);
+s_ident *     env_operator_ident (s_env *env, const s_ident *op,
+                                  s_ident *dest);
+bool          env_eval_integer (s_env *env, const s_integer *integer,
+                                s_integer *dest);
+bool          env_operator_is_right_associative (s_env *env,
+                                                 const s_ident *op);
+s8            env_operator_precedence (s_env *env, const s_ident *op);
+s_ident *     env_operator_resolve (s_env *env, const s_ident *op,
+                                    u8 arity, s_ident *dest);
+const s_sym * env_operator_symbol (s_env *env, const s_ident *op);
+u8            env_special_operator_arity (s_env *env,
+                                          const s_ident *ident);
+bool          env_struct_type_exists (s_env *env,
+                                      const s_sym *module);
+const s_struct_type *
+              env_struct_type_find (s_env *env, const s_sym *module);
+f_clean       env_struct_type_get_clean (s_env *env,
+                                         const s_sym *module);
+s_list **     env_struct_type_get_spec (s_env *env, const s_sym *module,
+                                        s_list **dest);
+bool          env_tag_ident_is_bound (const s_env *env,
+                                      const s_tag *tag,
+                                      s_facts *facts);
 
 /* Control structures. */
 void env_error_f (s_env *env, const char *fmt, ...);
diff --git a/libc3/ident.c b/libc3/ident.c
index 00259c4..b4c3a1a 100644
--- a/libc3/ident.c
+++ b/libc3/ident.c
@@ -201,9 +201,9 @@ bool ident_is_special_operator (const s_ident *ident)
   return env_ident_is_special_operator(&g_c3_env, ident);
 }
 
-void ident_resolve_module (s_ident *ident)
+s_ident * ident_resolve_module (const s_ident *ident, s_ident *dest)
 {
-  env_ident_resolve_module(&g_c3_env, ident);
+  return env_ident_resolve_module(&g_c3_env, ident, dest);
 }
 
 bool ident_to_tag_type (const s_ident *ident, e_tag_type *dest)
diff --git a/libc3/ident.h b/libc3/ident.h
index 91d7633..0c5b9cb 100644
--- a/libc3/ident.h
+++ b/libc3/ident.h
@@ -27,7 +27,7 @@ s_ident * ident_init_cast (s_ident *ident, const s_tag *tag);
 s_ident * ident_init_copy (s_ident *ident, const s_ident *src);
 
 /* Modifiers */
-s_ident * ident_resolve_module (s_ident *ident, const s_env *env);
+s_ident * ident_resolve_module (const s_ident *ident, s_ident *dest);
 
 /* Observers */
 bool    ident_character_is_reserved (character c);
diff --git a/libc3/io.c b/libc3/io.c
index 3e6c104..2811b9b 100644
--- a/libc3/io.c
+++ b/libc3/io.c
@@ -113,6 +113,7 @@ DEF_ERR_IO_INSPECT(fn_pattern, const s_list *)
 DEF_ERR_IO_INSPECT(ident,      const s_ident *)
 DEF_ERR_IO_INSPECT(list,       const s_list * const *)
 DEF_ERR_IO_INSPECT(map,        const s_map *)
+DEF_ERR_IO_INSPECT(ptr,        const u_ptr_w *)
 DEF_ERR_IO_INSPECT(s8,         const s8 *)
 DEF_ERR_IO_INSPECT(s16,        const s16 *)
 DEF_ERR_IO_INSPECT(s32,        const s32 *)
diff --git a/libc3/io.h b/libc3/io.h
index 1efeb27..e5b0a73 100644
--- a/libc3/io.h
+++ b/libc3/io.h
@@ -50,6 +50,7 @@ PROTOTYPES_ERR_IO_INSPECT(ident,      const s_ident *);
 PROTOTYPES_ERR_IO_INSPECT(integer,    const s_integer *);
 PROTOTYPES_ERR_IO_INSPECT(list,       const s_list * const *);
 PROTOTYPES_ERR_IO_INSPECT(map,        const s_map *);
+PROTOTYPES_ERR_IO_INSPECT(ptr,        const u_ptr_w *);
 PROTOTYPES_ERR_IO_INSPECT(s8,         const s8 *);
 PROTOTYPES_ERR_IO_INSPECT(s16,        const s16 *);
 PROTOTYPES_ERR_IO_INSPECT(s32,        const s32 *);
diff --git a/libtommath b/libtommath
index 59726bc..1957d6f 160000
--- a/libtommath
+++ b/libtommath
@@ -1 +1 @@
-Subproject commit 59726bc470de4397f425fec64652832b0aecdee1
+Subproject commit 1957d6f6c57aded3da4721067f175f9f8e0cd6da