Added (lib:import->path)

This commit is contained in:
Justin Ethier 2015-05-14 17:27:06 -04:00
parent 924b0943d2
commit f69f2412b5

View file

@ -1781,9 +1781,23 @@
(filename
(substring filename* 1 (string-length filename*))))
(if (tagged-list? 'scheme import)
(string-append (cyc:get-lib-dir filename)) ;; Built-in library
(string-append (cyc:get-lib-dir) filename) ;; Built-in library
filename)))
;; Get path to directory that contains the library
(define (lib:import->path import)
(let* ((import-path (reverse (cdr (reverse import))))
(path
(apply
string-append
(map
(lambda (i)
(string-append (symbol->string i) "/"))
import-path))))
(if (tagged-list? 'scheme import)
(string-append (cyc:get-lib-dir) path) ;; Built-in library
path)))
; !!!!!!!!!!!!!!!!!!!!!!!!
;TODO: all this basedir stuff below is silly. all we need is a way of saying OK, this
; is a system library so use cyc:get-lib-dir to find it. I think basedir just goes away