From f69f2412b5eb2ab6b05885d1c6a0c288463b25b2 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Thu, 14 May 2015 17:27:06 -0400 Subject: [PATCH] Added (lib:import->path) --- trans.scm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/trans.scm b/trans.scm index 0c5daae2..7c7289e4 100644 --- a/trans.scm +++ b/trans.scm @@ -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