From 332c3a55393814db3620ac7f3b02c8a4697c077e Mon Sep 17 00:00:00 2001 From: ESL Date: Fri, 5 Jul 2024 01:15:23 -0400 Subject: [PATCH] minor fixes --- src/t.scm | 7 ++++--- t.c | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/t.scm b/src/t.scm index 23699d8..154264c 100644 --- a/src/t.scm +++ b/src/t.scm @@ -1448,9 +1448,10 @@ (c-error "library path should end in directory separator" path))) (define (find-library-path libname) ;=> name of existing .sld file or #f + (define listname (if (symbol? libname) (symbol->listname libname) libname)) (let loop ([l *library-path-list*]) (and (pair? l) - (let ([p (libname->path libname (car l) ".sld")]) + (let ([p (listname->path libname (car l) ".sld")]) (if (and p (file-exists? p)) p (loop (cdr l))))))) #;(define (resolve-input-file/lib-name name) ;=> path (or error is signalled) @@ -1501,9 +1502,9 @@ (let ([s (read-code-sexp port)]) (unless (eof-object? s) (proc s) (loop))))))) -(define (library-available? lib) ;=> #f | filepath (external) | #t (loaded) +(define (library-available? lib) ;=> #f | filepath (external) | (code . eal) (loaded) (cond [(string? lib) (file-resolve-relative-to-current lib)] - [(library-info lib #f) #t] ; builtin or preloaded + [(library-info lib #f)] ; builtin or preloaded [else (and (or (symbol? lib) (list1+? lib)) (find-library-path lib))])) ; name prefixes diff --git a/t.c b/t.c index 74264eb..65a7c9f 100644 --- a/t.c +++ b/t.c @@ -770,8 +770,9 @@ char *t_code[] = { "irectory separator),@(y7:c-error)[12", "P", "find-library-path", - "%1@(y19:*library-path-list*),,#0.0,.3,&2{%1.0p?{${'(s4:.sld),.3a,:0,@(" - "y13:libname->path)[03},.0?{.0F0}{f}?{.0]2}.1d,:1^[21}f]1}.!0.0^_1[11", + "%1,#0.1Y0?{${.3,@(y16:symbol->listname)[01}}{.1}.!0@(y19:*library-path" + "-list*),,#0.0,.4,&2{%1.0p?{${'(s4:.sld),.3a,:0,@(y14:listname->path)[0" + "3},.0?{.0F0}{f}?{.0]2}.1d,:1^[21}f]1}.!0.0^_1[21", "P", "read-file-sexps", "%2.1,&1{%1:0?{t,.1P79}n,,#0.2,.1,&2{%1${:1,@(y14:read-code-sexp)[01},." @@ -780,8 +781,8 @@ char *t_code[] = { "P", "library-available?", "%1.0S0?{.0,@(y32:file-resolve-relative-to-current)[11}${f,.3,@(y12:lib" - "rary-info)[02}?{t]1}.0Y0,.0?{.0}{${.3,@(y7:list1+?)[01}}_1?{.0,@(y17:f" - "ind-library-path)[11}f]1", + "rary-info)[02},.0?{.0]2}.1Y0,.0?{.0}{${.4,@(y7:list1+?)[01}}_1?{.1,@(y" + "17:find-library-path)[21}f]2", "P", "fully-qualified-library-prefixed-name", "%2.1,'(y1:?),.2Y0?{.2}{${.4,@(y16:listname->symbol)[01}},@(y13:symbol-"