From: Chris Hanson Date: Wed, 8 Feb 2017 04:34:37 +0000 (-0800) Subject: Change the way boot inits work to accomodate packages with multiple files. X-Git-Tag: mit-scheme-pucked-9.2.12~220^2~166 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=ce307a1380f6e78eaaf2f99dece3ab871b996a1f;p=mit-scheme.git Change the way boot inits work to accomodate packages with multiple files. --- diff --git a/src/runtime/boot.scm b/src/runtime/boot.scm index 3350632a8..36fcd08e1 100644 --- a/src/runtime/boot.scm +++ b/src/runtime/boot.scm @@ -156,18 +156,23 @@ USA. (define (save-boot-inits! environment) (let ((inits (reverse! boot-inits))) (set! boot-inits #f) - ((ucode-primitive local-assignment) environment saved-boot-inits inits))) + (let ((p (assq environment saved-boot-inits))) + (if p + (set-cdr! p (append! (cdr p) inits)) + (begin + (set! saved-boot-inits + (cons (cons environment inits) + saved-boot-inits)) + unspecific))))) (define (get-boot-init-runner environment) - (and (not (lexical-unreferenceable? environment saved-boot-inits)) - (let ((inits - ((ucode-primitive lexical-reference) - environment - saved-boot-inits))) - ((ucode-primitive unbind-variable) environment saved-boot-inits) - (lambda () - (for-each (lambda (init) (init)) - inits))))) + (let ((p (assq environment saved-boot-inits))) + (and p + (let ((inits (cdr p))) + (set! saved-boot-inits (delq! p saved-boot-inits)) + (lambda () + (for-each (lambda (init) (init)) + inits)))))) (define boot-inits #f) -(define saved-boot-inits '|#[saved-boot-inits]|) \ No newline at end of file +(define saved-boot-inits '()) \ No newline at end of file