mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 13:49:17 +02:00
more helpful error messages on missing libraries
This commit is contained in:
parent
4cba9d3e6c
commit
105a4672e7
2 changed files with 24 additions and 2 deletions
|
@ -310,7 +310,29 @@
|
||||||
(lambda (a b)
|
(lambda (a b)
|
||||||
(string<? (write-to-string a) (write-to-string b))))))
|
(string<? (write-to-string a) (write-to-string b))))))
|
||||||
(else
|
(else
|
||||||
(display "... none found.\n" out))))))))))
|
(display "... none found.\n" out))))))))
|
||||||
|
((and (exception? exn)
|
||||||
|
(equal? "couldn't find import" (exception-message exn))
|
||||||
|
(pair? (exception-irritants exn)))
|
||||||
|
(let* ((mod-name (car (exception-irritants exn)))
|
||||||
|
(mod-file (module-name->file mod-name))
|
||||||
|
(scm-file (string-append
|
||||||
|
(substring mod-file
|
||||||
|
0
|
||||||
|
(- (string-length mod-file) 4))
|
||||||
|
".scm")))
|
||||||
|
(display "Searched module path " out)
|
||||||
|
(display (current-module-path) out)
|
||||||
|
(display " for " out)
|
||||||
|
(write mod-file out)
|
||||||
|
(display ".\n" out)
|
||||||
|
(cond
|
||||||
|
((find-module-file scm-file)
|
||||||
|
=> (lambda (file)
|
||||||
|
(display "But found non-module-definition file " out)
|
||||||
|
(write file out)
|
||||||
|
(display ".\nNote module files must end in \".sld\".\n" out)))))
|
||||||
|
)))
|
||||||
|
|
||||||
(define undefined-value (if #f #f))
|
(define undefined-value (if #f #f))
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
(define-library (chibi repl)
|
(define-library (chibi repl)
|
||||||
(export repl $0 $1 $2 $3 $4 $5 $6 $7 $8 $9)
|
(export repl $0 $1 $2 $3 $4 $5 $6 $7 $8 $9)
|
||||||
(import (chibi) (only (meta) load-module)
|
(import (chibi) (only (meta) load-module module-name->file)
|
||||||
(chibi ast) (chibi modules) (chibi doc)
|
(chibi ast) (chibi modules) (chibi doc)
|
||||||
(chibi string) (chibi io) (chibi optional)
|
(chibi string) (chibi io) (chibi optional)
|
||||||
(chibi process) (chibi term edit-line)
|
(chibi process) (chibi term edit-line)
|
||||||
|
|
Loading…
Add table
Reference in a new issue