~ubuntu-branches/ubuntu/intrepid/ecl/intrepid

« back to all changes in this revision

Viewing changes to src/c/compiler.d

  • Committer: Bazaar Package Importer
  • Author(s): Peter Van Eynde
  • Date: 2007-04-09 11:51:51 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070409115151-ql8cr0kalzx1jmla
Tags: 0.9i-20070324-2
Upload to unstable. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
static int compile_body(cl_object args, int flags);
108
108
static int compile_form(cl_object args, int push);
109
109
 
 
110
static cl_object ecl_make_lambda(cl_object name, cl_object lambda);
 
111
 
110
112
static void FEillegal_variable_name(cl_object) /*__attribute__((noreturn))*/;
111
113
static void FEill_formed_input(void) /*__attribute__((noreturn))*/;
112
114
 
144
146
 
145
147
        /* Save bytecodes from this session in a new vector */
146
148
        code_size = current_pc() - beginning;
147
 
        data_size = length(ENV->constants);
 
149
        data_size = ecl_length(ENV->constants);
148
150
        bytecodes = cl_alloc_object(t_bytecodes);
149
151
        bytecodes->bytecodes.code_size = code_size;
150
152
        bytecodes->bytecodes.data_size = data_size;
189
191
static void
190
192
asm_constant(cl_object c)
191
193
{
192
 
        ENV->constants = nconc(ENV->constants, CONS(c, Cnil));
 
194
        ENV->constants = ecl_nconc(ENV->constants, CONS(c, Cnil));
193
195
}
194
196
 
195
197
static cl_index
272
274
/* ----------------- LEXICAL ENVIRONMENT HANDLING -------------------- */
273
275
 
274
276
static void
 
277
assert_type_symbol(cl_object v)
 
278
{
 
279
        if (type_of(v) != t_symbol)
 
280
                FEprogram_error("Expected a symbol, found ~S.", 1, v);
 
281
}
 
282
 
 
283
static void
275
284
FEillegal_variable_name(cl_object v)
276
285
{
277
286
        FEprogram_error("Not a valid variable name ~S.", 1, v);
289
298
        cl_object p = ENV->constants;
290
299
        int n;
291
300
        for (n = 0; !Null(p); n++, p=CDR(p)) {
292
 
                if (ENV->coalesce && eql(CAR(p), c)) {
 
301
                if (ENV->coalesce && ecl_eql(CAR(p), c)) {
293
302
                        return n;
294
303
                }
295
304
        }
452
461
                type = CAR(record);
453
462
                name = CADR(record);
454
463
                if (type == @':tag') {
455
 
                        if (type == the_type && !Null(assql(the_tag, name)))
 
464
                        if (type == the_type && !Null(ecl_assql(the_tag, name)))
456
465
                                return CONS(MAKE_FIXNUM(n),
457
 
                                            CDR(assql(the_tag, name)));
 
466
                                            CDR(ecl_assql(the_tag, name)));
458
467
                        n++;
459
468
                } else if (type == @':block' || type == @':function') {
460
469
                        /* We compare with EQUAL, because of (SETF fname) */
461
 
                        if (type == the_type && equal(name, the_tag))
 
470
                        if (type == the_type && ecl_equal(name, the_tag))
462
471
                                return MAKE_FIXNUM(n);
463
472
                        n++;
464
473
                } else if (Null(name)) {
510
519
static bool
511
520
c_declared_special(register cl_object var, register cl_object specials)
512
521
{
513
 
        return ((var->symbol.stype == stp_special) || member_eq(var, specials));
 
522
        return ((var->symbol.stype == stp_special) || ecl_member_eq(var, specials));
514
523
}
515
524
 
516
525
static void
633
642
/*
634
643
 * This routine is used to change the compilation flags in optimizers
635
644
 * that do not want to push values onto the stack, but also do not want
636
 
 * to use REG0 (maybe because the call a nested interpret()). Ignorable
 
645
 * to use REG0 (maybe because the call a nested ecl_interpret()). Ignorable
637
646
 * forms are kept ignored:
638
647
 *      FLAG_PUSH               -> FLAG_VALUES
639
648
 *      FLAG_VALUES             -> FLAG_VALUES
732
741
static int
733
742
c_arguments(cl_object args) {
734
743
        cl_index nargs;
735
 
        for (nargs = 0; !endp(args); nargs++) {
 
744
        for (nargs = 0; !ecl_endp(args); nargs++) {
736
745
                compile_form(pop(&args), FLAG_PUSH);
737
746
        }
738
747
        return nargs;
816
825
        } else {
817
826
                cl_index labeln, labelz;
818
827
                if (CONSP(test)) {
819
 
                        cl_index n = length(test);
 
828
                        cl_index n = ecl_length(test);
820
829
                        while (n-- > 1) {
821
830
                                cl_object v = pop(&test);
822
831
                                asm_op(OP_JEQL);
831
840
                labeln = current_pc();
832
841
                asm_arg(0);
833
842
                compile_body(clause, flags);
834
 
                if (endp(args) && !(flags & FLAG_USEFUL)) {
 
843
                if (ecl_endp(args) && !(flags & FLAG_USEFUL)) {
835
844
                        /* Ther is no otherwise. The test has failed and
836
845
                           we need no output value. We simply close jumps. */
837
846
                        asm_complete(0 & OP_JNEQL, labeln);
892
901
        cl_object bindings;
893
902
        bds_ptr old_bds_top = cl_env.bds_top;
894
903
 
895
 
        for (bindings = pop(&args); !endp(bindings); ) {
 
904
        for (bindings = pop(&args); !ecl_endp(bindings); ) {
896
905
                cl_object form = pop(&bindings);
897
906
                cl_object var = pop(&form);
898
907
                cl_object value = pop_maybe_nil(&form);
1024
1033
c_eval_when(cl_object args, int flags) {
1025
1034
        cl_object situation = pop(&args);
1026
1035
 
1027
 
        if (member_eq(@'eval', situation) || member_eq(@':execute', situation))
 
1036
        if (ecl_member_eq(@'eval', situation) || ecl_member_eq(@':execute', situation))
1028
1037
                return compile_body(args, flags);
1029
1038
        else
1030
1039
                return compile_body(Cnil, flags);
1047
1056
c_register_functions(cl_object l)
1048
1057
{
1049
1058
        cl_index nfun;
1050
 
        for (nfun = 0; !endp(l); nfun++) {
 
1059
        for (nfun = 0; !ecl_endp(l); nfun++) {
1051
1060
                cl_object definition = pop(&l);
1052
1061
                cl_object name = pop(&definition);
1053
1062
                c_register_function(name);
1071
1080
        /* If compiling a LABELS form, add the function names to the lexical
1072
1081
           environment before compiling the functions */
1073
1082
        if (op == OP_FLET)
1074
 
                nfun = length(def_list);
 
1083
                nfun = ecl_length(def_list);
1075
1084
        else
1076
1085
                nfun = c_register_functions(def_list);
1077
1086
 
1079
1088
        asm_op2(op, nfun);
1080
1089
 
1081
1090
        /* Compile the local functions now. */
1082
 
        for (l = def_list; !endp(l); ) {
 
1091
        for (l = def_list; !ecl_endp(l); ) {
1083
1092
                cl_object definition = pop(&l);
1084
1093
                cl_object name = pop(&definition);
1085
 
                asm_c(make_lambda(name, definition));
 
1094
                asm_c(ecl_make_lambda(name, definition));
1086
1095
        }
1087
1096
 
1088
1097
        /* If compiling a FLET form, add the function names to the lexical
1122
1131
static int
1123
1132
c_function(cl_object args, int flags) {
1124
1133
        cl_object function = pop(&args);
1125
 
        if (!endp(args))
 
1134
        if (!ecl_endp(args))
1126
1135
                FEprogram_error("FUNCTION: Too many arguments.", 0);
1127
1136
        return asm_function(function, flags);
1128
1137
}
1139
1148
                        asm_op2(OP_LFUNCTION, fix(ndx));
1140
1149
                }
1141
1150
        } else if (CONSP(function) && CAR(function) == @'lambda') {
1142
 
                asm_op2c(OP_CLOSE, make_lambda(Cnil, CDR(function)));
 
1151
                asm_op2c(OP_CLOSE, ecl_make_lambda(Cnil, CDR(function)));
1143
1152
        } else if (CONSP(function) && CAR(function) == @'ext::lambda-block') {
1144
1153
                cl_object name = CADR(function);
1145
1154
                cl_object body = CDDR(function);
1146
 
                asm_op2c(OP_CLOSE, make_lambda(name, body));
 
1155
                asm_op2c(OP_CLOSE, ecl_make_lambda(name, body));
1147
1156
        } else {
1148
1157
                FEprogram_error("FUNCTION: Not a valid argument ~S.", 1, function);
1149
1158
        }
1188
1197
        compile_form(pop(&form), flags);
1189
1198
 
1190
1199
        /* ... and then ELSE */
1191
 
        if (endp(form)) {
 
1200
        if (ecl_endp(form)) {
1192
1201
                /* ... in case there is any! */
1193
1202
                asm_complete(OP_JNIL, label_nil);
1194
1203
        } else {
1258
1267
        specials = VALUES(3);
1259
1268
 
1260
1269
        /* Optimize some common cases */
1261
 
        switch(length(bindings)) {
 
1270
        switch(ecl_length(bindings)) {
1262
1271
        case 0:         return c_locally(CDR(args), flags);
1263
1272
        case 1:         op = OP_BIND; break;
1264
1273
        }
1265
1274
 
1266
 
        for (vars=Cnil, l=bindings; !endp(l); ) {
 
1275
        for (vars=Cnil, l=bindings; !ecl_endp(l); ) {
1267
1276
                cl_object aux = pop(&l);
1268
1277
                cl_object var, value;
1269
1278
                if (ATOM(aux)) {
1285
1294
                        c_bind(var, specials);
1286
1295
                }
1287
1296
        }
1288
 
        while (!endp(vars))
 
1297
        while (!ecl_endp(vars))
1289
1298
                c_pbind(pop(&vars), specials);
1290
1299
 
1291
1300
        /* We have to register all specials, because in the list
1358
1367
        specials = VALUES(3);
1359
1368
 
1360
1369
        compile_form(value, FLAG_VALUES);
1361
 
        n = length(vars);
 
1370
        n = ecl_length(vars);
1362
1371
        if (n == 0) {
1363
1372
                c_declare_specials(specials);
1364
1373
                flags = compile_body(body, flags);
1392
1401
        int op;
1393
1402
 
1394
1403
        name = pop(&args);
1395
 
        if (endp(args)) {
 
1404
        if (ecl_endp(args)) {
1396
1405
                /* If no arguments, just use ordinary call */
1397
1406
                return c_funcall(cl_list(1, name), flags);
1398
1407
        }
1399
1408
        compile_form(name, FLAG_PUSH);
1400
 
        for (op = OP_PUSHVALUES; !endp(args); op = OP_PUSHMOREVALUES) {
 
1409
        for (op = OP_PUSHVALUES; !ecl_endp(args); op = OP_PUSHMOREVALUES) {
1401
1410
                compile_form(pop(&args), FLAG_VALUES);
1402
1411
                asm_op(op);
1403
1412
        }
1410
1419
static int
1411
1420
c_multiple_value_prog1(cl_object args, int flags) {
1412
1421
        compile_form(pop(&args), FLAG_VALUES);
1413
 
        if (!endp(args)) {
 
1422
        if (!ecl_endp(args)) {
1414
1423
                asm_op(OP_PUSHVALUES);
1415
1424
                compile_body(args, FLAG_VALUES);
1416
1425
                asm_op(OP_POPVALUES);
1429
1438
 
1430
1439
        /* Look for symbol macros, building the list of variables
1431
1440
           and the list of late assignments. */
1432
 
        for (orig_vars = pop(&args); !endp(orig_vars); ) {
 
1441
        for (orig_vars = pop(&args); !ecl_endp(orig_vars); ) {
1433
1442
                cl_object v = pop(&orig_vars);
1434
1443
                if (!SYMBOLP(v))
1435
1444
                        FEillegal_variable_name(v);
1589
1598
        bool use_psetf = FALSE;
1590
1599
        cl_index nvars = 0;
1591
1600
 
1592
 
        if (endp(old_args))
 
1601
        if (ecl_endp(old_args))
1593
1602
                return compile_body(Cnil, flags);
1594
1603
        /* We have to make sure that non of the variables which
1595
1604
           are to be assigned is actually a symbol macro. If that
1596
1605
           is the case, we invoke (PSETF ...) to handle the
1597
1606
           macro expansions.
1598
1607
        */
1599
 
        while (!endp(old_args)) {
 
1608
        while (!ecl_endp(old_args)) {
1600
1609
                cl_object var = pop(&old_args);
1601
1610
                cl_object value = pop(&old_args);
1602
1611
                if (!SYMBOLP(var))
1604
1613
                var = c_macro_expand1(var);
1605
1614
                if (!SYMBOLP(var))
1606
1615
                        use_psetf = TRUE;
1607
 
                args = nconc(args, cl_list(2, var, value));
 
1616
                args = ecl_nconc(args, cl_list(2, var, value));
1608
1617
                nvars++;
1609
1618
        }
1610
1619
        if (use_psetf) {
1611
1620
                return compile_form(CONS(@'psetf', args), flags);
1612
1621
        }
1613
 
        while (!endp(args)) {
 
1622
        while (!ecl_endp(args)) {
1614
1623
                cl_object var = pop(&args);
1615
1624
                cl_object value = pop(&args);
1616
1625
                vars = CONS(var, vars);
1617
1626
                compile_form(value, FLAG_PUSH);
1618
1627
        }
1619
 
        while (!endp(vars))
 
1628
        while (!ecl_endp(vars))
1620
1629
                compile_setq(OP_PSETQ, pop(&vars));
1621
1630
        return compile_form(Cnil, flags);
1622
1631
}
1660
1669
 
1661
1670
static int
1662
1671
c_setq(cl_object args, int flags) {
1663
 
        if (endp(args))
 
1672
        if (ecl_endp(args))
1664
1673
                return compile_form(Cnil, flags);
1665
1674
        do {
1666
1675
                cl_object var = pop(&args);
1673
1682
                        compile_form(value, FLAG_REG0);
1674
1683
                        compile_setq(OP_SETQ, var);
1675
1684
                } else {
1676
 
                        flags = endp(args)? FLAG_VALUES : FLAG_REG0;
 
1685
                        flags = ecl_endp(args)? FLAG_VALUES : FLAG_REG0;
1677
1686
                        compile_form(cl_list(3, @'setf', var, value), flags);
1678
1687
                }
1679
 
        } while (!endp(args));
 
1688
        } while (!ecl_endp(args));
1680
1689
        return flags;
1681
1690
}
1682
1691
 
1692
1701
        specials = VALUES(3);
1693
1702
 
1694
1703
        /* Scan the list of definitions */
1695
 
        for (; !endp(def_list); ) {
 
1704
        for (; !ecl_endp(def_list); ) {
1696
1705
                cl_object definition = pop(&def_list);
1697
1706
                cl_object name = pop(&definition);
1698
1707
                cl_object expansion = pop(&definition);
1705
1714
declared special and appear in a symbol-macrolet.", 1, name);
1706
1715
                }
1707
1716
                definition = cl_list(2, arglist, cl_list(2, @'quote', expansion));
1708
 
                function = make_lambda(name, definition);
 
1717
                function = ecl_make_lambda(name, definition);
1709
1718
                c_register_symbol_macro(name, function);
1710
1719
        }
1711
1720
        c_declare_specials(specials);
1724
1733
        int nt, i;
1725
1734
 
1726
1735
        /* count the tags */
1727
 
        for (nt = 0, body = args; !endp(body); body = CDR(body)) {
 
1736
        for (nt = 0, body = args; !ecl_endp(body); body = CDR(body)) {
1728
1737
                label = CAR(body);
1729
1738
                item_type = type_of(CAR(body));
1730
1739
                if (item_type == t_symbol || item_type == t_fixnum ||
1743
1752
        for (i = nt; i; i--)
1744
1753
                asm_arg(0);
1745
1754
 
1746
 
        for (body = args; !endp(body); body = CDR(body)) {
 
1755
        for (body = args; !ecl_endp(body); body = CDR(body)) {
1747
1756
                label = CAR(body);
1748
1757
                item_type = type_of(label);
1749
1758
                if (item_type == t_symbol || item_type == t_fixnum ||
1767
1776
*/
1768
1777
static int
1769
1778
c_throw(cl_object stmt, int flags) {
1770
 
        /* FIXME! Do we apply the right protocol here? */
1771
1779
        cl_object tag = pop(&stmt);
1772
1780
        cl_object form = pop(&stmt);
1773
1781
        if (stmt != Cnil)
1808
1816
        if (!(flags & FLAG_USEFUL)) {
1809
1817
                /* This value will be discarded. We do not care to
1810
1818
                   push it or to save it in VALUES */
1811
 
                if (endp(args))
 
1819
                if (ecl_endp(args))
1812
1820
                        return flags;
1813
1821
                return compile_body(args, flags);
1814
1822
        } else if (flags & FLAG_PUSH) {
1815
1823
                /* We only need the first value. However, the rest
1816
1824
                   of arguments HAVE to be be evaluated */
1817
 
                if (endp(args))
 
1825
                if (ecl_endp(args))
1818
1826
                        return compile_form(Cnil, flags);
1819
1827
                flags = compile_form(pop(&args), FLAG_PUSH);
1820
1828
                compile_body(args, FLAG_IGNORE);
1821
1829
                return flags;
1822
 
        } else if (endp(args)) {
 
1830
        } else if (ecl_endp(args)) {
1823
1831
                asm_op(OP_NOP);
1824
1832
        } else {
1825
1833
                int n = 0;
1826
 
                while (!endp(args)) {
 
1834
                while (!ecl_endp(args)) {
1827
1835
                        compile_form(pop_maybe_nil(&args), FLAG_PUSH);
1828
1836
                        n++;
1829
1837
                }
1841
1849
        bool push = flags & FLAG_PUSH;
1842
1850
        int new_flags;
1843
1851
 
1844
 
        /* FIXME! We should protect this region with error handling */
1845
1852
 BEGIN:
1846
1853
        if (code_walker != OBJNULL) {
1847
1854
                stmt = funcall(3, SYM_VAL(@'si::*code-walker*'), stmt,
1956
1963
 
1957
1964
static int
1958
1965
compile_body(cl_object body, int flags) {
1959
 
        if (ENV->lexical_level == 0 && !endp(body)) {
1960
 
                while (!endp(CDR(body))) {
 
1966
        if (ENV->lexical_level == 0 && !ecl_endp(body)) {
 
1967
                while (!ecl_endp(CDR(body))) {
1961
1968
                        struct cl_compiler_env *old_c_env = ENV;
1962
1969
                        struct cl_compiler_env new_c_env = *old_c_env;
1963
1970
                        cl_index handle;
1969
1976
                        VALUES(0) = Cnil;
1970
1977
                        NVALUES = 0;
1971
1978
                        bytecodes = asm_end(handle);
1972
 
                        interpret(bytecodes, bytecodes->bytecodes.code);
 
1979
                        ecl_interpret(bytecodes, bytecodes->bytecodes.code);
1973
1980
                        asm_clear(handle);
1974
1981
                        ENV = old_c_env;
1975
1982
#ifdef GBC_BOEHM
1980
1987
                        body = CDR(body);
1981
1988
                }
1982
1989
        }
1983
 
        if (endp(body)) {
 
1990
        if (ecl_endp(body)) {
1984
1991
                return compile_form(Cnil, flags);
1985
1992
        } else {
1986
1993
                do {
1987
 
                        if (endp(CDR(body)))
 
1994
                        if (ecl_endp(CDR(body)))
1988
1995
                                return compile_form(CAR(body), flags);
1989
1996
                        compile_form(CAR(body), FLAG_IGNORE);
1990
1997
                        body = CDR(body);
2032
2039
        cl_object decls, vars, v;
2033
2040
@
2034
2041
        /* BEGIN: SEARCH DECLARE */
2035
 
        for (; !endp(body); body = CDR(body)) {
 
2042
        for (; !ecl_endp(body); body = CDR(body)) {
2036
2043
          form = CAR(body);
2037
2044
 
2038
 
          if (!Null(doc) && type_of(form) == t_base_string && !endp(CDR(body))) {
 
2045
          if (!Null(doc) && type_of(form) == t_base_string && !ecl_endp(CDR(body))) {
2039
2046
            if (documentation == Cnil)
2040
2047
              documentation = form;
2041
2048
            else
2046
2053
          if (ATOM(form) || (CAR(form) != @'declare'))
2047
2054
            break;
2048
2055
 
2049
 
          for (decls = CDR(form); !endp(decls); decls = CDR(decls)) {
 
2056
          for (decls = CDR(form); !ecl_endp(decls); decls = CDR(decls)) {
2050
2057
            cl_object sentence = CAR(decls);
2051
2058
            if (ATOM(sentence))
2052
2059
              FEill_formed_input();
2053
2060
            push(sentence, declarations);
2054
2061
            if (CAR(sentence) == @'special')
2055
 
              for (vars = CDR(sentence); !endp(vars); vars = CDR(vars)) {
 
2062
              for (vars = CDR(sentence); !ecl_endp(vars); vars = CDR(vars)) {
2056
2063
                v = CAR(vars);
2057
2064
                assert_type_symbol(v);
2058
2065
                push(v,specials);
2198
2205
                if (!ATOM(v)) {
2199
2206
                        cl_object x = v;
2200
2207
                        v = CAR(x);
2201
 
                        if (!endp(x = CDR(x))) {
 
2208
                        if (!ecl_endp(x = CDR(x))) {
2202
2209
                                init = CAR(x);
2203
 
                                if (!endp(x = CDR(x))) {
 
2210
                                if (!ecl_endp(x = CDR(x))) {
2204
2211
                                        spp = CAR(x);
2205
 
                                        if (!endp(CDR(x)))
 
2212
                                        if (!ecl_endp(CDR(x)))
2206
2213
                                                goto ILLEGAL_LAMBDA;
2207
2214
                                }
2208
2215
                        }
2226
2233
                if (!ATOM(v)) {
2227
2234
                        cl_object x = v;
2228
2235
                        v = CAR(x);
2229
 
                        if (!endp(x = CDR(x))) {
 
2236
                        if (!ecl_endp(x = CDR(x))) {
2230
2237
                                init = CAR(x);
2231
 
                                if (!endp(x = CDR(x))) {
 
2238
                                if (!ecl_endp(x = CDR(x))) {
2232
2239
                                        spp = CAR(x);
2233
 
                                        if (!endp(CDR(x)))
 
2240
                                        if (!ecl_endp(CDR(x)))
2234
2241
                                                goto ILLEGAL_LAMBDA;
2235
2242
                                }
2236
2243
                        }
2237
2244
                }
2238
2245
                if (CONSP(v)) {
2239
2246
                        key = CAR(v);
2240
 
                        if (endp(CDR(v)) || !endp(CDDR(v)))
 
2247
                        if (ecl_endp(CDR(v)) || !ecl_endp(CDDR(v)))
2241
2248
                                goto ILLEGAL_LAMBDA;
2242
2249
                        v = CADR(v);
2243
2250
                        if (context == @'function')
2246
2253
                } else {
2247
2254
                        int intern_flag;
2248
2255
                        assert_type_symbol(v);
2249
 
                        key = intern(v->symbol.name, cl_core.keyword_package, &intern_flag);
 
2256
                        key = ecl_intern(v->symbol.name, cl_core.keyword_package, &intern_flag);
2250
2257
                }
2251
2258
                nkey++;
2252
2259
                push(key, keys);
2261
2268
        default:
2262
2269
                if (ATOM(v)) {
2263
2270
                        init = Cnil;
2264
 
                } else if (endp(CDDR(v))) {
 
2271
                } else if (ecl_endp(CDDR(v))) {
2265
2272
                        cl_object x = v;
2266
2273
                        v = CAR(x);
2267
2274
                        init = CADR(x);
2315
2322
         * prologue of the interpreted function. */
2316
2323
        if (Null(var))
2317
2324
                return;
2318
 
        if (member_eq(var, *specials))
 
2325
        if (ecl_member_eq(var, *specials))
2319
2326
                c_register_var(var, TRUE, TRUE);
2320
2327
        else if (var->symbol.stype == stp_special) {
2321
2328
                *specials = CONS(var, *specials);
2327
2334
}
2328
2335
 
2329
2336
cl_object
2330
 
make_lambda(cl_object name, cl_object lambda) {
 
2337
ecl_make_lambda(cl_object name, cl_object lambda) {
2331
2338
        cl_object reqs, opts, rest, key, keys, auxs, allow_other_keys;
2332
2339
        cl_object specials, doc, decl, body, output;
2333
2340
        cl_index label;
2362
2369
 
2363
2370
        ENV->constants = reqs;                  /* Special arguments */
2364
2371
        reqs = CDR(reqs);
2365
 
        while (!endp(reqs)) {
 
2372
        while (!ecl_endp(reqs)) {
2366
2373
                cl_object v = pop(&reqs);
2367
2374
                c_register_var2(v, &specials);
2368
2375
        }
2369
2376
 
2370
2377
        nopts = fix(CAR(opts));                 /* Optional arguments */
2371
 
        ENV->constants = nconc(ENV->constants, opts);
 
2378
        ENV->constants = ecl_nconc(ENV->constants, opts);
2372
2379
 
2373
2380
        asm_constant(rest);                     /* Name of &rest argument */
2374
2381
 
2378
2385
        } else {
2379
2386
                asm_constant(allow_other_keys); /* Value of &allow-other-keys */
2380
2387
                nkeys = fix(CAR(keys));         /* Keyword arguments */
2381
 
                ENV->constants = nconc(ENV->constants, keys);
 
2388
                ENV->constants = ecl_nconc(ENV->constants, keys);
2382
2389
        }
2383
2390
        asm_constant(doc);
2384
2391
        asm_constant(decl);
2407
2414
                set_pc(handle);
2408
2415
        else
2409
2416
                asm_complete(OP_JMP, label);
2410
 
        while (!endp(auxs)) {           /* Local bindings */
 
2417
        while (!ecl_endp(auxs)) {               /* Local bindings */
2411
2418
                cl_object var = pop(&auxs);
2412
2419
                cl_object value = pop(&auxs);
2413
2420
                compile_form(value, FLAG_REG0);
2467
2474
        old_c_env = ENV;
2468
2475
        c_new_env(&new_c_env, Cnil);
2469
2476
        CL_UNWIND_PROTECT_BEGIN {
2470
 
                lambda = make_lambda(name,rest);
 
2477
                lambda = ecl_make_lambda(name,rest);
2471
2478
        } CL_UNWIND_PROTECT_EXIT {
2472
2479
                ENV = old_c_env;
2473
2480
        } CL_UNWIND_PROTECT_END;
2514
2521
        cl_env.lex_env = interpreter_env;
2515
2522
        VALUES(0) = Cnil;
2516
2523
        NVALUES = 0;
2517
 
        interpret(bytecodes, bytecodes->bytecodes.code);
 
2524
        ecl_interpret(bytecodes, bytecodes->bytecodes.code);
2518
2525
#ifdef GBC_BOEHM
2519
2526
        GC_free(bytecodes->bytecodes.code);
2520
2527
        GC_free(bytecodes->bytecodes.data);