(procedure (cddr objects)))
(lose))))
\f
-;;;; Boot initializers
+;;;; Boot-time initializers
(define (init-boot-inits!)
(set! boot-inits '())
unspecific)
(define (add-boot-init! thunk)
- (if boot-inits
+ (if (and booting? boot-inits)
(set! boot-inits (cons thunk boot-inits))
(thunk))
unspecific)
(define (save-boot-inits! environment)
- (if boot-inits
+ (if (pair? boot-inits)
(let ((inits (reverse! boot-inits)))
(set! boot-inits #f)
(let ((p (assq environment saved-boot-inits)))
(for-each (lambda (init) (init))
inits))))))
+(define (finished-booting!)
+ (set! booting? #f)
+ (if (pair? boot-inits)
+ (warn "boot-inits not saved:" boot-inits))
+ (if (pair? saved-boot-inits)
+ (warn "saved-boot-inits not run:" saved-boot-inits)))
+
+(define booting? #t)
(define boot-inits #f)
(define saved-boot-inits '())
\f
(let ((environment (package/environment (find-package package-name)))
(runtime (pathname-as-directory "runtime"))
(rundir (system-library-directory-pathname "runtime" #t)))
- (if (not init-expression) (init-boot-inits!))
(for-each
(lambda (file)
(let ((file (force* file)))
#t))))))))))
files)
(flush-purification-queue!)
- (if (not init-expression)
- (begin
- (save-boot-inits! environment)
- ((get-boot-init-runner environment)))
+ (if init-expression
(eval init-expression environment)))))
(define (force* value)
`((SET-DEFAULT-DIRECTORY
,top-level-repl/set-default-directory))
user-initial-prompt)
- (cmdl-message/strings "Cold load finished")))))
+ (cmdl-message/append
+ (cmdl-message/active
+ (lambda (port)
+ (declare (ignore port))
+ (finished-booting!)))
+ (cmdl-message/strings "Cold load finished"))))))
(define root-continuation)
with-limited-interrupts
without-interrupts)
(export (runtime)
- add-boot-init!)
- (export (runtime options)
- get-boot-init-runner
- init-boot-inits!
- save-boot-inits!))
+ add-boot-init!
+ defer-boot-action
+ run-deferred-boot-actions)
+ (export (runtime rep)
+ finished-booting!))
(define-package (runtime equality)
(files "equals")