load-package.scm 737 B

12345678910111213141516171819202122232425
  1. ; Part of Scheme 48 1.9. See file COPYING for notices and license.
  2. ; Authors: Richard Kelsey, Jonathan Rees
  3. (define (ensure-loaded . structs)
  4. (force-output (current-output-port)) ; avoid interleaved output
  5. (let ((out (current-noise-port)))
  6. (for-each (lambda (package)
  7. (display #\[ out)
  8. (display (package-name package) out)
  9. (with-interaction-environment package
  10. (lambda ()
  11. (invoke-closure
  12. (make-closure (compile-package package)
  13. (package-uid package)))))
  14. (set-package-loaded?! package #t)
  15. (walk-population check-structure
  16. (package-clients package))
  17. (display #\] out)
  18. (newline out))
  19. (collect-packages structs
  20. (lambda (package)
  21. (not (package-loaded? package)))))))