Adding warning to remind people to (import (scheme base)).

This commit is contained in:
Alex Shinn 2013-04-01 21:55:18 +09:00
parent 64931197a6
commit 95215e9228

View file

@ -167,6 +167,15 @@
(%import env (module-env mod2) (cdr mod2-name+imports) #t)))
(cdr x)))))
meta)
(guard
(exn (else
(module-meta-data-set! mod meta)
(if (not (any (lambda (x)
(and (pair? x)
(memq (car x) '(import import-immutable))))
meta))
(warn "WARNING: exception inside module with no imports - did you forget to (import (scheme base)) in" name))
(raise-continuable exn)))
(for-each
(lambda (x)
(case (and (pair? x) (car x))
@ -180,7 +189,7 @@
(for-each (lambda (expr) (eval expr env)) (cdr x)))
((error)
(apply error (cdr x)))))
meta)
meta))
(module-meta-data-set! mod meta)
(warn-undefs env #f)
env))