mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-08 21:47:33 +02:00
Reporting explicitly when no matching module exports are found.
This commit is contained in:
parent
c74e14cbdb
commit
8bc0a3b454
1 changed files with 18 additions and 15 deletions
|
@ -284,21 +284,24 @@
|
||||||
(equal? "undefined variable" (exception-message exn))
|
(equal? "undefined variable" (exception-message exn))
|
||||||
(pair? (exception-irritants exn)))
|
(pair? (exception-irritants exn)))
|
||||||
(let ((name (car (exception-irritants exn))))
|
(let ((name (car (exception-irritants exn))))
|
||||||
(display "Searching for modules exporting " out)
|
(cond
|
||||||
(display name out)
|
((identifier? name)
|
||||||
(display " ...\n" out)
|
(display "Searching for modules exporting " out)
|
||||||
(let ((mods (and (identifier? name)
|
(display name out)
|
||||||
(modules-exporting-identifier name))))
|
(display " ...\n" out)
|
||||||
(cond
|
(let ((mods (modules-exporting-identifier name)))
|
||||||
((pair? mods)
|
(cond
|
||||||
(display name out)
|
((pair? mods)
|
||||||
(display " is exported by:\n")
|
(display name out)
|
||||||
(for-each
|
(display " is exported by:\n")
|
||||||
(lambda (m)
|
(for-each
|
||||||
(display " " out) (write m out) (newline out))
|
(lambda (m)
|
||||||
(sort (map car mods)
|
(display " " out) (write m out) (newline out))
|
||||||
(lambda (a b)
|
(sort (map car mods)
|
||||||
(string<? (write-to-string a) (write-to-string b))))))))))))
|
(lambda (a b)
|
||||||
|
(string<? (write-to-string a) (write-to-string b))))))
|
||||||
|
(else
|
||||||
|
(display "... none found.\n"))))))))))
|
||||||
|
|
||||||
(define (repl/eval rp expr-list)
|
(define (repl/eval rp expr-list)
|
||||||
(let ((out (repl-out rp)))
|
(let ((out (repl-out rp)))
|
||||||
|
|
Loading…
Add table
Reference in a new issue