load-package.scm 708 B

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