From 86744b24dbcee97c7ed57923ee589078db1136cb Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Fri, 15 Nov 2019 16:36:50 +0100 Subject: [PATCH] boot-module: primitive-load hack --- mes/module/mes/boot-module.scm | 4 +++- src/eval-apply.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mes/module/mes/boot-module.scm b/mes/module/mes/boot-module.scm index 3ef38317..f8a64f14 100644 --- a/mes/module/mes/boot-module.scm +++ b/mes/module/mes/boot-module.scm @@ -1764,7 +1764,9 @@ (resolve-module dir-hint-module-name #f) (and (not (autoload-done-or-in-progress? dir-hint name)) (let ((didit #f)) - (define (load-file proc file) + ;; FIXME: *undefined* here is a terrible hack; it switches + ;; toplevel for defines. + (define (load-file *undefined* file) (save-module-excursion (lambda () (primitive-load file))) (set! didit #t)) (dynamic-wind diff --git a/src/eval-apply.c b/src/eval-apply.c index 7c63c665..682d3e4f 100644 --- a/src/eval-apply.c +++ b/src/eval-apply.c @@ -596,7 +596,8 @@ eval: if (R1->car == cell_symbol_define || R1->car == cell_symbol_define_macro) { global_p = 0; - if (R0->car->car != cell_closure) + if (R0->car->car != cell_closure + || R0->cdr->car->car == cell_undefined) global_p = 1; #if 0 else if (g_debug > 0)