From 2d096f5f2bfa851ebed28da55939578f10fe226d Mon Sep 17 00:00:00 2001 From: vyzo Date: Sun, 15 Oct 2023 20:45:22 +0300 Subject: [PATCH] fix loadpath --- src/gerbil/runtime/init.ss | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/gerbil/runtime/init.ss b/src/gerbil/runtime/init.ss index 32fdb5d05..696626792 100644 --- a/src/gerbil/runtime/init.ss +++ b/src/gerbil/runtime/init.ss @@ -243,19 +243,21 @@ namespace: #f ;; initialize the load path (let* ((home (gerbil-home)) (libdir (path-expand "lib" home)) - (loadpath - (cond - ((getenv "GERBIL_LOADPATH" #f) - => (lambda (envvar) - (filter (lambda (x) (not (string-empty? x))) - (string-split envvar #\:)))) - (else '()))) (userpath (path-expand "lib" (gerbil-path))) (loadpath (if (getenv "GERBIL_BUILD_PREFIX" #f) - (cons loadpath libdir) - (cons* loadpath userpath libdir)))) + [libdir] + [userpath libdir])) + (loadpath + (cond + ((getenv "GERBIL_LOADPATH" #f) + => (lambda (envvar) + (append + (filter (lambda (x) (not (string-empty? x))) + (string-split envvar #\:)) + loadpath))) + (else loadpath)))) (current-module-library-path loadpath)) ;; initialize the modue registry