From: Chris Hanson Date: Mon, 21 Oct 2019 05:37:00 +0000 (-0700) Subject: Furthur improve error reporting for libraries. X-Git-Tag: mit-scheme-pucked-10.1.20~11^2~30 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=4424a420f021fcebdd3bcd96fd76478da5d88fee;p=mit-scheme.git Furthur improve error reporting for libraries. --- diff --git a/src/runtime/library-database.scm b/src/runtime/library-database.scm index 23919a9ab..2c71c93d3 100644 --- a/src/runtime/library-database.scm +++ b/src/runtime/library-database.scm @@ -118,7 +118,10 @@ USA. (if (not auto) (error "Unknown property:" key)) (if (not (auto-runnable? auto this)) - (error "Auto property not ready:" key)) + (error "Auto property not ready:" + key + (error-irritant/noise " because of") + (auto-unready-deps auto this))) (let ((bindings (run-auto auto this))) (set-cdr! alist (append bindings (cdr alist))) (cdr (assq key bindings))))))) @@ -213,6 +216,18 @@ USA. (library 'get key)) (auto-deps auto)))))) +(define (auto-unready-deps auto library) + (if (every (lambda (key) + (library 'has? key)) + (auto-deps auto)) + (list "guard expr") + (map (lambda (key) + (let ((auto* (automatic-property key))) + (if auto* + (cons key (auto-unready-deps auto* library)) + key))) + (auto-deps auto)))) + (define (run-auto auto library) (let ((runner (lambda ()