diff --git a/include/mes/symbols.h b/include/mes/symbols.h index 08b9f6c7..5bbe75cb 100644 --- a/include/mes/symbols.h +++ b/include/mes/symbols.h @@ -40,6 +40,7 @@ struct scm *cell_vm_begin_expand_eval; struct scm *cell_vm_begin_expand_macro; struct scm *cell_vm_begin_expand_primitive_load; struct scm *cell_vm_begin_primitive_load; +struct scm *cell_vm_primitive_load_return; struct scm *cell_vm_begin_read_input_file; struct scm *cell_vm_call_with_current_continuation2; struct scm *cell_vm_call_with_values2; @@ -136,8 +137,8 @@ struct scm *cell_type_broken_heart; struct scm *cell_symbol_program; struct scm *cell_symbol_test; -// CONSTANT SYMBOL_MAX 113 -#define SYMBOL_MAX 113 +// CONSTANT SYMBOL_MAX 114 +#define SYMBOL_MAX 114 // CONSTANT CELL_UNSPECIFIED 7 #define CELL_UNSPECIFIED 7 diff --git a/mes/module/mes/boot-03.scm b/mes/module/mes/boot-03.scm index e2c7ce53..ca1887c3 100644 --- a/mes/module/mes/boot-03.scm +++ b/mes/module/mes/boot-03.scm @@ -168,4 +168,3 @@ ;; end boot-03.scm (primitive-load 0) -(primitive-load 0) diff --git a/src/eval-apply.c b/src/eval-apply.c index aa613150..5940ae88 100644 --- a/src/eval-apply.c +++ b/src/eval-apply.c @@ -389,6 +389,8 @@ eval_apply: goto macro_expand_define_macro; else if (R3 == cell_vm_begin_primitive_load) goto begin_primitive_load; + else if (R3 == cell_vm_primitive_load_return) + goto primitive_load_return; else if (R3 == cell_vm_evlis) goto evlis; @@ -875,11 +877,13 @@ begin_expand: assert_msg (0, "begin-expand-boom 0"); } - push_cc (input, R2, R0, cell_vm_return); + if (global_p == 1) + push_cc (input, R2, R0, cell_vm_return); + else + push_cc (input, R2, R0, cell_vm_primitive_load_return); x = read_input_file_env (R0); if (g_debug > 5) hash_table_printer (R0); - gc_pop_frame (); input = R1; R1 = x; set_current_input_port (input); @@ -958,6 +962,10 @@ call_with_values2: R1 = cons (R2->cdr->car, R1); goto apply; +primitive_load_return: + gc_pop_frame (); + /* fall through */ + vm_return: x = R1; gc_pop_frame (); diff --git a/src/symbol.c b/src/symbol.c index 488b2a7a..78be0271 100644 --- a/src/symbol.c +++ b/src/symbol.c @@ -76,6 +76,7 @@ init_symbols_ () /*:((internal)) */ cell_vm_begin_expand_macro = init_symbol (g_symbol, TSPECIAL, "*vm:begin-expand-macro*"); cell_vm_begin_expand_primitive_load = init_symbol (g_symbol, TSPECIAL, "*vm:core:begin-expand-primitive-load*"); cell_vm_begin_primitive_load = init_symbol (g_symbol, TSPECIAL, "*vm:core:begin-primitive-load*"); + cell_vm_primitive_load_return = init_symbol (g_symbol, TSPECIAL, "*vm:core:primitive-load-return*"); cell_vm_begin_read_input_file = init_symbol (g_symbol, TSPECIAL, "*vm-begin-read-input-file*"); cell_vm_call_with_current_continuation2 = init_symbol (g_symbol, TSPECIAL, "*vm-call-with-current-continuation2*"); cell_vm_call_with_values2 = init_symbol (g_symbol, TSPECIAL, "*vm-call-with-values2*");