better error message when a library file "foo.ss" does not contain

the expected library name (foo).
This commit is contained in:
Abdulaziz Ghuloum
2008-06-05 00:58:04 -07:00
parent 81db526510
commit 6741ac2817
3 changed files with 31 additions and 14 deletions
+13 -1
View File
@@ -226,7 +226,19 @@
[else
((current-library-expander)
(read-library-source-file file-name)
file-name)])))
file-name
(lambda (name)
(unless (equal? name x)
(assertion-violation 'import
(let-values ([(p e) (open-string-output-port)])
(display "expected to find library " p)
(write x p)
(display " in file " p)
(display file-name p)
(display ", found " p)
(write name p)
(display " instead" p)
(e))))))])))
(lambda (f)
(if (procedure? f)
f