* boot-9.scm (load-module): When loading files from within files
authorMikael Djurfeldt <djurfeldt@nada.kth.se>
Thu, 18 Jun 1998 23:59:24 +0000 (23:59 +0000)
committerMikael Djurfeldt <djurfeldt@nada.kth.se>
Thu, 18 Jun 1998 23:59:24 +0000 (23:59 +0000)
themselves being loaded: Use the directory path of the file being
loaded as root for relative filenames.  (After suggestion by
Steven G. Johnson.)

ice-9/ChangeLog
ice-9/boot-9.scm

index b3cbcb0..2a2e32f 100644 (file)
@@ -1,3 +1,10 @@
+1998-06-19  Mikael Djurfeldt  <mdj@barbara.nada.kth.se>
+
+       * boot-9.scm (load-module): When loading files from within files
+       themselves being loaded: Use the directory path of the file being
+       loaded as root for relative filenames.  (After suggestion by
+       Steven G. Johnson.)
+
 1998-06-15  Mikael Djurfeldt  <mdj@mdj.nada.kth.se>
 
        * emacs.scm (emacs-load): New feature: Eval in specified module.
index 105c1f7..158a4c5 100644 (file)
 
 (define basic-load load)
 
-(define (load-module . args)
-  (save-module-excursion (lambda () (apply basic-load args))))
+(define (load-module filename)
+  (save-module-excursion
+   (lambda ()
+     (let ((oldname (and (current-load-port)
+                        (port-filename (current-load-port)))))
+       (basic-load (if (and oldname
+                           (> (string-length filename) 0)
+                           (not (char=? (string-ref filename 0) #\/))
+                           (not (string=? (dirname oldname) ".")))
+                      (string-append (dirname oldname) "/" filename)
+                      filename))))))
 
 
 \f
 
 
 (define load load-module)
-;(define (load . args)
-;  (start-stack 'load-stack (apply load-module args)))
 
 
 \f