diff options
Diffstat (limited to 'guile.init')
-rw-r--r-- | guile.init | 35 |
1 files changed, 15 insertions, 20 deletions
@@ -370,26 +370,21 @@ ;;; (let ((load-file (guile:wrap-case-insensitive load))) ;;; (lambda (<pathname>) ;;; (load-file (string-append <pathname> (scheme-file-suffix)))))) -;; Two changes from the normal slib thing here: -;; 1. Load from the path -;; 2. Importantly: guarantee that loaded files land in the slib module. -(define (slib:load name) - (save-module-excursion - (lambda () - (set-current-module slib-module) - (let ((errinfo (catch 'system-error - (lambda () - (load-from-path name) - #f) - (lambda args args)))) - (if (and errinfo - (catch 'system-error - (lambda () - (load-from-path - (string-append name ".scm")) - #f) - (lambda args args))) - (apply throw errinfo)))))) +(define (slib:load-helper loader) + (lambda (name) + (save-module-excursion + (lambda () + (set-current-module slib-module) + (let ((errinfo (catch 'system-error + (lambda () (loader name) #f) + (lambda args args)))) + (if (and errinfo + (catch 'system-error + (lambda () (loader (string-append name ".scm")) #f) + (lambda args args))) + (apply throw errinfo))))))) +(define slib:load (slib:load-helper load)) +(define slib:load-from-path (slib:load-helper load-from-path)) (define slib:load-source slib:load) |