expander: another approach to fixing nested instantiation

Mostly reverts ee4ceb7ae4 and tries a different approach. The prevoius
approach did not handle the case where the module begin instantiated
was tiggered by a module at a different (higher) phase.

Closes #2981
This commit is contained in:
Matthew Flatt 2019-12-17 13:33:31 -07:00
parent 6b1dad21eb
commit 63bc848f79
6 changed files with 223 additions and 151 deletions

View File

@ -3143,6 +3143,40 @@ case of module-leve bindings; it doesn't cover local bindings.
(test (void) namespace-require ''lang-is-imports-uses-local-expand)
(test #t namespace? (module->namespace ''lang-is-imports-uses-local-expand)))
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Similar to previous, but with a `for-template` in the mix
(module uses-local-expand-at-phase-1-instantiation-again racket/base
(require (for-syntax racket/base
(for-syntax racket/base)))
(provide (for-syntax true))
(struct Π- (X))
(begin-for-syntax
(define TY/internal+ (local-expand #'Π- 'expression null))
(define true (lambda (x) #t))))
(module imports-uses-local-expand-at-phase-1-instantiation-again racket/base
(require (for-syntax racket/base)
'uses-local-expand-at-phase-1-instantiation-again)
(provide #%module-begin)
(define-for-syntax predicate true))
(module local-expand-test2-reflect racket/base
(require (for-template 'uses-local-expand-at-phase-1-instantiation-again))
(define x true))
(module local-expand-test2 racket/base
(provide #%module-begin)
(require 'imports-uses-local-expand-at-phase-1-instantiation-again
(for-syntax 'local-expand-test2-reflect)))
(module lang-is-local-expand-test2 'local-expand-test2)
(let ()
;; important that both of these are in the same top-level evaluation:
(test (void) namespace-require ''lang-is-local-expand-test2)
(test #t namespace? (module->namespace ''lang-is-local-expand-test2)))
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Check order of checking for redefinition of a constant

View File

@ -221,7 +221,13 @@
(define ns-1 (namespace->namespace-at-phase ns (phase+ phase-shift (sub1 phase-level))))
(parameterize ([current-namespace ns])
(parameterize-like
#:with ([current-expand-context (delay (make-expand-context ns-1))]
#:with ([current-expand-context (delay (make-expand-context
ns-1
;; Turn off on-demand instantiation, because
;; we're already trying to instantiate modules,
;; and anything that should be relevant by being
;; imported here should be instantiated already:
#:skip-visit-available? #t))]
[current-module-code-inspector insp])
(instantiate-body)))]))))))

View File

@ -71,13 +71,15 @@
for-serializable? ; accumulate submodules as serializable?
to-correlated-linklet? ; compile to machine-independent linklets?
normalize-locals? ; forget original local-variable names
should-not-encounter-macros?)) ; #t when "expanding" to parse
should-not-encounter-macros? ; #t when "expanding" to parse
skip-visit-available?)) ; avoid instantiation cycles
(define (make-expand-context ns
#:to-parsed? [to-parsed? #f]
#:for-serializable? [for-serializable? #f]
#:to-correlated-linklet? [to-correlated-linklet? #f]
#:observer [observer #f])
#:observer [observer #f]
#:skip-visit-available? [skip-visit-available? #f])
(define root-ctx (namespace-get-root-expand-ctx ns))
(expand-context (root-expand-context-self-mpi root-ctx)
(root-expand-context-module-scopes root-ctx)
@ -120,7 +122,8 @@
for-serializable?
to-correlated-linklet?
to-correlated-linklet? ; normalize-locals?
#f))
#f
skip-visit-available?))
(define (copy-root-expand-context ctx root-ctx)
(struct*-copy expand-context ctx

View File

@ -111,7 +111,8 @@
#:track-to-be-defined? track-to-be-defined?))
(without-expand-context
(namespace-visit-available-modules! (expand-context-namespace ctx) phase))
(unless (expand-context-skip-visit-available? ctx)
(namespace-visit-available-modules! (expand-context-namespace ctx) phase)))
(log-expand local-ctx 'enter-local s)
(define input-s (add-intdef-scopes (flip-introduction-scopes s ctx) intdefs))

View File

@ -139,7 +139,7 @@
(struct module-instance (namespace
module ; can be #f for the module being expanded
[shifted-requires #:mutable] ; computed on demand; shifted from `module-requires`
phase-level-to-state ; phase-level -> #f, 'available, 'trying-to-start, or 'started
phase-level-to-state ; phase-level -> #f, 'available, or 'started
[made-available? #:mutable] ; no #f in `phase-level-to-state`?
[attached? #:mutable] ; whether the instance has been attached elsewhere
data-box) ; for use by module implementation
@ -417,9 +417,7 @@
(define instance-phase (namespace-0-phase m-ns))
(define run-phase-level (phase- run-phase instance-phase))
(unless (and (or skip-run?
(let ([v (small-hash-ref (module-instance-phase-level-to-state mi) run-phase-level #f)])
(or (eq? 'started v)
(eq? 'trying-to-start v))))
(eq? 'started (small-hash-ref (module-instance-phase-level-to-state mi) run-phase-level #f)))
(or (not otherwise-available?)
(module-instance-made-available? mi)))
;; Something to do...
@ -433,13 +431,6 @@
(when (hash-ref seen mi #f)
(error 'require "import cycle detected during module instantiation"))
(unless (or skip-run?
(eq? (small-hash-ref (module-instance-phase-level-to-state mi) run-phase-level #f) 'started))
;; In case instantiating imported modules does something that triggers
;; a force of available modules, make sure we don't try to instantiate
;; while we're in the process of instantiating:
(small-hash-set! (module-instance-phase-level-to-state mi) run-phase-level 'trying-to-start))
;; If we haven't shifted required mpis already, do that
(unless (module-instance-shifted-requires mi)
(set-module-instance-shifted-requires!

View File

@ -68,10 +68,10 @@ static const char *startup_source =
"(1/use-compiled-file-check use-compiled-file-check)"
"(1/use-compiled-file-paths use-compiled-file-paths)"
"(1/use-user-specific-search-paths use-user-specific-search-paths))"
"(define-values(call/ec) call-with-escape-continuation)"
"(define-values"
"(qq-append)"
" (lambda (a_0 b_0) (begin (if (list? a_0) (append a_0 b_0) (raise-argument-error 'unquote-splicing \"list?\" a_0)))))"
"(define-values(call/ec) call-with-escape-continuation)"
"(define-values"
"(fixnum-for-every-system?)"
"(lambda(v_0)(begin(if(fixnum? v_0)(if(fx>= v_0 -536870912)(fx<= v_0 536870911) #f) #f))))"
@ -14207,13 +14207,12 @@ static const char *startup_source =
"(if(if(let-values(((or-part_0) skip-run?_0))"
"(if or-part_0"
" or-part_0"
"(let-values(((v_0)"
"(eq?"
" 'started"
"(small-hash-ref"
"(module-instance-phase-level-to-state mi_0)"
" run-phase-level_0"
" #f)))"
"(let-values(((or-part_1)(eq? 'started v_0)))"
"(if or-part_1 or-part_1(eq? 'trying-to-start v_0))))))"
" #f))))"
"(let-values(((or-part_0)(not otherwise-available?_0)))"
"(if or-part_0 or-part_0(module-instance-made-available? mi_0)))"
" #f)"
@ -14240,21 +14239,6 @@ static const char *startup_source =
" 'require"
" \"import cycle detected during module instantiation\"))"
"(void))"
"(if(let-values(((or-part_0) skip-run?_0))"
"(if or-part_0"
" or-part_0"
"(eq?"
"(small-hash-ref"
"(module-instance-phase-level-to-state mi_0)"
" run-phase-level_0"
" #f)"
" 'started)))"
"(void)"
"(let-values()"
"(small-hash-set!"
"(module-instance-phase-level-to-state mi_0)"
" run-phase-level_0"
" 'trying-to-start)))"
"(if(module-instance-shifted-requires mi_0)"
"(void)"
"(let-values()"
@ -15552,20 +15536,21 @@ static const char *startup_source =
" expand-context/inner-for-serializable?"
" expand-context/inner-to-correlated-linklet?"
" expand-context/inner-normalize-locals?"
" expand-context/inner-should-not-encounter-macros?)"
" expand-context/inner-should-not-encounter-macros?"
" expand-context/inner-skip-visit-available?)"
"(let-values(((struct:_0 make-_0 ?_0 -ref_0 -set!_0)"
"(let-values()"
"(let-values()"
"(make-struct-type"
" 'expand-context/inner"
" struct:root-expand-context/inner"
" 21"
" 22"
" 0"
" #f"
"(list(cons prop:authentic #t))"
"(current-inspector)"
" #f"
" '(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20)"
" '(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21)"
" #f"
" 'expand-context/inner)))))"
"(values"
@ -15592,7 +15577,8 @@ static const char *startup_source =
"(make-struct-field-accessor -ref_0 17 'for-serializable?)"
"(make-struct-field-accessor -ref_0 18 'to-correlated-linklet?)"
"(make-struct-field-accessor -ref_0 19 'normalize-locals?)"
"(make-struct-field-accessor -ref_0 20 'should-not-encounter-macros?))))"
"(make-struct-field-accessor -ref_0 20 'should-not-encounter-macros?)"
"(make-struct-field-accessor -ref_0 21 'skip-visit-available?))))"
"(define-values"
"(expand-context/make)"
"(lambda(self-mpi_0"
@ -15636,7 +15622,8 @@ static const char *startup_source =
" for-serializable?_0"
" to-correlated-linklet?_0"
" normalize-locals?_0"
" should-not-encounter-macros?_0)"
" should-not-encounter-macros?_0"
" skip-visit-available?_0)"
"(begin"
"(expand-context/outer1.1"
"(expand-context/inner2.1"
@ -15667,7 +15654,8 @@ static const char *startup_source =
" for-serializable?_0"
" to-correlated-linklet?_0"
" normalize-locals?_0"
" should-not-encounter-macros?_0)"
" should-not-encounter-macros?_0"
" skip-visit-available?_0)"
" post-expansion_0"
" use-site-scopes_0"
" frame-id_0"
@ -15763,15 +15751,19 @@ static const char *startup_source =
"(expand-context-should-not-encounter-macros?)"
"(lambda(v_0)(begin(expand-context/inner-should-not-encounter-macros?(root-expand-context/outer-inner v_0)))))"
"(define-values"
"(expand-context-skip-visit-available?)"
"(lambda(v_0)(begin(expand-context/inner-skip-visit-available?(root-expand-context/outer-inner v_0)))))"
"(define-values"
"(make-expand-context.1)"
"(lambda(for-serializable?4_0 observer6_0 to-correlated-linklet?5_0 to-parsed?3_0 ns11_0)"
"(lambda(for-serializable?4_0 observer6_0 skip-visit-available?7_0 to-correlated-linklet?5_0 to-parsed?3_0 ns13_0)"
"(begin"
" 'make-expand-context"
"(let-values(((ns_0) ns11_0))"
"(let-values(((ns_0) ns13_0))"
"(let-values(((to-parsed?_0) to-parsed?3_0))"
"(let-values(((for-serializable?_0) for-serializable?4_0))"
"(let-values(((to-correlated-linklet?_0) to-correlated-linklet?5_0))"
"(let-values(((observer_0) observer6_0))"
"(let-values(((skip-visit-available?_0) skip-visit-available?7_0))"
"(let-values()"
"(let-values(((root-ctx_0)(namespace-get-root-expand-ctx ns_0)))"
"(expand-context/make"
@ -15816,7 +15808,8 @@ static const char *startup_source =
" for-serializable?_0"
" to-correlated-linklet?_0"
" to-correlated-linklet?_0"
" #f)))))))))))"
" #f"
" skip-visit-available?_0))))))))))))"
"(define-values"
"(copy-root-expand-context)"
"(lambda(ctx_0 root-ctx_0)"
@ -15824,29 +15817,29 @@ static const char *startup_source =
"(let-values(((v_0) ctx_0))"
"(let-values(((the-struct_0) v_0))"
"(if(expand-context/outer? the-struct_0)"
"(let-values(((post-expansion23_0)(root-expand-context-post-expansion root-ctx_0))"
"((use-site-scopes24_0)(root-expand-context-use-site-scopes root-ctx_0))"
"((frame-id25_0)(root-expand-context-frame-id root-ctx_0))"
"((binding-layer26_0)(root-expand-context-frame-id root-ctx_0))"
"((inner27_0)"
"(let-values(((post-expansion25_0)(root-expand-context-post-expansion root-ctx_0))"
"((use-site-scopes26_0)(root-expand-context-use-site-scopes root-ctx_0))"
"((frame-id27_0)(root-expand-context-frame-id root-ctx_0))"
"((binding-layer28_0)(root-expand-context-frame-id root-ctx_0))"
"((inner29_0)"
"(let-values(((the-struct_1)(root-expand-context/outer-inner v_0)))"
"(if(expand-context/inner? the-struct_1)"
"(let-values(((self-mpi28_0)(root-expand-context-self-mpi root-ctx_0))"
"((module-scopes29_0)(root-expand-context-module-scopes root-ctx_0))"
"((top-level-bind-scope30_0)"
"(let-values(((self-mpi30_0)(root-expand-context-self-mpi root-ctx_0))"
"((module-scopes31_0)(root-expand-context-module-scopes root-ctx_0))"
"((top-level-bind-scope32_0)"
"(root-expand-context-top-level-bind-scope root-ctx_0))"
"((all-scopes-stx31_0)(root-expand-context-all-scopes-stx root-ctx_0))"
"((defined-syms32_0)(root-expand-context-defined-syms root-ctx_0))"
"((counter33_0)(root-expand-context-counter root-ctx_0))"
"((lift-key34_0)(root-expand-context-lift-key root-ctx_0)))"
"((all-scopes-stx33_0)(root-expand-context-all-scopes-stx root-ctx_0))"
"((defined-syms34_0)(root-expand-context-defined-syms root-ctx_0))"
"((counter35_0)(root-expand-context-counter root-ctx_0))"
"((lift-key36_0)(root-expand-context-lift-key root-ctx_0)))"
"(expand-context/inner2.1"
" self-mpi28_0"
" module-scopes29_0"
" top-level-bind-scope30_0"
" all-scopes-stx31_0"
" defined-syms32_0"
" counter33_0"
" lift-key34_0"
" self-mpi30_0"
" module-scopes31_0"
" top-level-bind-scope32_0"
" all-scopes-stx33_0"
" defined-syms34_0"
" counter35_0"
" lift-key36_0"
"(expand-context/inner-to-parsed? the-struct_1)"
"(expand-context/inner-phase the-struct_1)"
"(expand-context/inner-namespace the-struct_1)"
@ -15867,18 +15860,19 @@ static const char *startup_source =
"(expand-context/inner-for-serializable? the-struct_1)"
"(expand-context/inner-to-correlated-linklet? the-struct_1)"
"(expand-context/inner-normalize-locals? the-struct_1)"
"(expand-context/inner-should-not-encounter-macros? the-struct_1)))"
"(expand-context/inner-should-not-encounter-macros? the-struct_1)"
"(expand-context/inner-skip-visit-available? the-struct_1)))"
" (raise-argument-error 'struct-copy \"expand-context/inner?\" the-struct_1)))))"
"(expand-context/outer1.1"
" inner27_0"
" post-expansion23_0"
" use-site-scopes24_0"
" frame-id25_0"
" inner29_0"
" post-expansion25_0"
" use-site-scopes26_0"
" frame-id27_0"
"(expand-context/outer-context the-struct_0)"
"(expand-context/outer-env the-struct_0)"
"(expand-context/outer-scopes the-struct_0)"
"(expand-context/outer-def-ctx-scopes the-struct_0)"
" binding-layer26_0"
" binding-layer28_0"
"(expand-context/outer-reference-records the-struct_0)"
"(expand-context/outer-only-immediate? the-struct_0)"
"(expand-context/outer-need-eventually-defined the-struct_0)"
@ -15892,11 +15886,11 @@ static const char *startup_source =
"(lambda()(begin(continuation-mark-set-first #f current-expand-context default-val.1$1 root-tag))))"
"(define-values"
"(get-current-expand-context.1)"
"(lambda(fail-ok?13_0 who15_0)"
"(lambda(fail-ok?15_0 who17_0)"
"(begin"
" 'get-current-expand-context"
"(let-values(((who_0) who15_0))"
"(let-values(((fail-ok?_0) fail-ok?13_0))"
"(let-values(((who_0) who17_0))"
"(let-values(((fail-ok?_0) fail-ok?15_0))"
"(let-values()"
"(let-values(((or-part_0)(force(current-expand-context))))"
" (if or-part_0 or-part_0 (if fail-ok?_0 #f (raise-arguments-error who_0 \"not currently expanding\"))))))))))"
@ -15922,16 +15916,16 @@ static const char *startup_source =
"(let-values(((v_0) ctx_0))"
"(let-values(((the-struct_0) v_0))"
"(if(expand-context/outer? the-struct_0)"
"(let-values(((context35_0) 'expression)"
"((name36_0) #f)"
"((post-expansion37_0) #f)"
"((inner38_0)(root-expand-context/outer-inner v_0)))"
"(let-values(((context37_0) 'expression)"
"((name38_0) #f)"
"((post-expansion39_0) #f)"
"((inner40_0)(root-expand-context/outer-inner v_0)))"
"(expand-context/outer1.1"
" inner38_0"
" post-expansion37_0"
" inner40_0"
" post-expansion39_0"
"(root-expand-context/outer-use-site-scopes the-struct_0)"
"(root-expand-context/outer-frame-id the-struct_0)"
" context35_0"
" context37_0"
"(expand-context/outer-env the-struct_0)"
"(expand-context/outer-scopes the-struct_0)"
"(expand-context/outer-def-ctx-scopes the-struct_0)"
@ -15941,7 +15935,7 @@ static const char *startup_source =
"(expand-context/outer-need-eventually-defined the-struct_0)"
"(expand-context/outer-current-introduction-scopes the-struct_0)"
"(expand-context/outer-current-use-scopes the-struct_0)"
" name36_0))"
" name38_0))"
" (raise-argument-error 'struct-copy \"expand-context/outer?\" the-struct_0)))))))))"
"(define-values"
"(as-begin-expression-context)"
@ -15953,39 +15947,7 @@ static const char *startup_source =
"(let-values(((v_0) ctx_0))"
"(let-values(((the-struct_0) v_0))"
"(if(expand-context/outer? the-struct_0)"
"(let-values(((name39_0) #f)((inner40_0)(root-expand-context/outer-inner v_0)))"
"(expand-context/outer1.1"
" inner40_0"
"(root-expand-context/outer-post-expansion the-struct_0)"
"(root-expand-context/outer-use-site-scopes the-struct_0)"
"(root-expand-context/outer-frame-id the-struct_0)"
"(expand-context/outer-context the-struct_0)"
"(expand-context/outer-env the-struct_0)"
"(expand-context/outer-scopes the-struct_0)"
"(expand-context/outer-def-ctx-scopes the-struct_0)"
"(expand-context/outer-binding-layer the-struct_0)"
"(expand-context/outer-reference-records the-struct_0)"
"(expand-context/outer-only-immediate? the-struct_0)"
"(expand-context/outer-need-eventually-defined the-struct_0)"
"(expand-context/outer-current-introduction-scopes the-struct_0)"
"(expand-context/outer-current-use-scopes the-struct_0)"
" name39_0))"
" (raise-argument-error 'struct-copy \"expand-context/outer?\" the-struct_0)))))))))"
"(define-values"
"(as-tail-context.1)"
"(lambda(wrt17_0 ctx19_0)"
"(begin"
" 'as-tail-context"
"(let-values(((ctx_0) ctx19_0))"
"(let-values(((wrt-ctx_0) wrt17_0))"
"(let-values()"
"(if(expand-context-name wrt-ctx_0)"
"(let-values()"
"(let-values(((v_0) ctx_0))"
"(let-values(((the-struct_0) v_0))"
"(if(expand-context/outer? the-struct_0)"
"(let-values(((name41_0)(expand-context-name wrt-ctx_0))"
"((inner42_0)(root-expand-context/outer-inner v_0)))"
"(let-values(((name41_0) #f)((inner42_0)(root-expand-context/outer-inner v_0)))"
"(expand-context/outer1.1"
" inner42_0"
"(root-expand-context/outer-post-expansion the-struct_0)"
@ -16002,18 +15964,22 @@ static const char *startup_source =
"(expand-context/outer-current-introduction-scopes the-struct_0)"
"(expand-context/outer-current-use-scopes the-struct_0)"
" name41_0))"
" (raise-argument-error 'struct-copy \"expand-context/outer?\" the-struct_0)))))"
"(let-values() ctx_0))))))))"
" (raise-argument-error 'struct-copy \"expand-context/outer?\" the-struct_0)))))))))"
"(define-values"
"(as-named-context)"
"(lambda(ctx_0 ids_0)"
"(as-tail-context.1)"
"(lambda(wrt19_0 ctx21_0)"
"(begin"
"(if(if(pair? ids_0)(null?(cdr ids_0)) #f)"
" 'as-tail-context"
"(let-values(((ctx_0) ctx21_0))"
"(let-values(((wrt-ctx_0) wrt19_0))"
"(let-values()"
"(if(expand-context-name wrt-ctx_0)"
"(let-values()"
"(let-values(((v_0) ctx_0))"
"(let-values(((the-struct_0) v_0))"
"(if(expand-context/outer? the-struct_0)"
"(let-values(((name43_0)(car ids_0))((inner44_0)(root-expand-context/outer-inner v_0)))"
"(let-values(((name43_0)(expand-context-name wrt-ctx_0))"
"((inner44_0)(root-expand-context/outer-inner v_0)))"
"(expand-context/outer1.1"
" inner44_0"
"(root-expand-context/outer-post-expansion the-struct_0)"
@ -16030,6 +15996,34 @@ static const char *startup_source =
"(expand-context/outer-current-introduction-scopes the-struct_0)"
"(expand-context/outer-current-use-scopes the-struct_0)"
" name43_0))"
" (raise-argument-error 'struct-copy \"expand-context/outer?\" the-struct_0)))))"
"(let-values() ctx_0))))))))"
"(define-values"
"(as-named-context)"
"(lambda(ctx_0 ids_0)"
"(begin"
"(if(if(pair? ids_0)(null?(cdr ids_0)) #f)"
"(let-values()"
"(let-values(((v_0) ctx_0))"
"(let-values(((the-struct_0) v_0))"
"(if(expand-context/outer? the-struct_0)"
"(let-values(((name45_0)(car ids_0))((inner46_0)(root-expand-context/outer-inner v_0)))"
"(expand-context/outer1.1"
" inner46_0"
"(root-expand-context/outer-post-expansion the-struct_0)"
"(root-expand-context/outer-use-site-scopes the-struct_0)"
"(root-expand-context/outer-frame-id the-struct_0)"
"(expand-context/outer-context the-struct_0)"
"(expand-context/outer-env the-struct_0)"
"(expand-context/outer-scopes the-struct_0)"
"(expand-context/outer-def-ctx-scopes the-struct_0)"
"(expand-context/outer-binding-layer the-struct_0)"
"(expand-context/outer-reference-records the-struct_0)"
"(expand-context/outer-only-immediate? the-struct_0)"
"(expand-context/outer-need-eventually-defined the-struct_0)"
"(expand-context/outer-current-introduction-scopes the-struct_0)"
"(expand-context/outer-current-use-scopes the-struct_0)"
" name45_0))"
" (raise-argument-error 'struct-copy \"expand-context/outer?\" the-struct_0)))))"
"(let-values() ctx_0)))))"
"(define-values"
@ -16039,12 +16033,12 @@ static const char *startup_source =
"(let-values(((v_0) ctx_0))"
"(let-values(((the-struct_0) v_0))"
"(if(expand-context/outer? the-struct_0)"
"(let-values(((inner45_0)"
"(let-values(((inner47_0)"
"(let-values(((the-struct_1)(root-expand-context/outer-inner v_0)))"
"(if(expand-context/inner? the-struct_1)"
"(let-values(((to-parsed?46_0) #t)"
"((observer47_0) #f)"
"((should-not-encounter-macros?48_0) #t))"
"(let-values(((to-parsed?48_0) #t)"
"((observer49_0) #f)"
"((should-not-encounter-macros?50_0) #t))"
"(expand-context/inner2.1"
"(root-expand-context/inner-self-mpi the-struct_1)"
"(root-expand-context/inner-module-scopes the-struct_1)"
@ -16053,7 +16047,7 @@ static const char *startup_source =
"(root-expand-context/inner-defined-syms the-struct_1)"
"(root-expand-context/inner-counter the-struct_1)"
"(root-expand-context/inner-lift-key the-struct_1)"
" to-parsed?46_0"
" to-parsed?48_0"
"(expand-context/inner-phase the-struct_1)"
"(expand-context/inner-namespace the-struct_1)"
"(expand-context/inner-just-once? the-struct_1)"
@ -16069,14 +16063,15 @@ static const char *startup_source =
"(expand-context/inner-require-lifts the-struct_1)"
"(expand-context/inner-to-module-lifts the-struct_1)"
"(expand-context/inner-requires+provides the-struct_1)"
" observer47_0"
" observer49_0"
"(expand-context/inner-for-serializable? the-struct_1)"
"(expand-context/inner-to-correlated-linklet? the-struct_1)"
"(expand-context/inner-normalize-locals? the-struct_1)"
" should-not-encounter-macros?48_0))"
" should-not-encounter-macros?50_0"
"(expand-context/inner-skip-visit-available? the-struct_1)))"
" (raise-argument-error 'struct-copy \"expand-context/inner?\" the-struct_1)))))"
"(expand-context/outer1.1"
" inner45_0"
" inner47_0"
"(root-expand-context/outer-post-expansion the-struct_0)"
"(root-expand-context/outer-use-site-scopes the-struct_0)"
"(root-expand-context/outer-frame-id the-struct_0)"
@ -38482,10 +38477,13 @@ static const char *startup_source =
"(promise1.1"
"(lambda()"
"(let-values(((ns-151_0)"
" ns-1_0))"
" ns-1_0)"
"((temp52_0)"
" #t))"
"(make-expand-context.1"
" #f"
" #f"
" temp52_0"
" #f"
" #f"
" ns-151_0)))"
@ -38594,20 +38592,20 @@ static const char *startup_source =
"(void))"
"(values))))"
"(let-values(((inst_0)"
"(let-values(((ns53_0) ns_0)"
"((phase-shift54_0) phase-shift_0)"
"((self55_0) self_0)"
"((insp56_0) insp_0)"
"((bulk-binding-registry57_0) bulk-binding-registry_0)"
"((temp58_0)"
"(let-values(((ns54_0) ns_0)"
"((phase-shift55_0) phase-shift_0)"
"((self56_0) self_0)"
"((insp57_0) insp_0)"
"((bulk-binding-registry58_0) bulk-binding-registry_0)"
"((temp59_0)"
" (lambda (name_0 val_0) (error \"shouldn't get here for the root-ctx linklet\"))))"
"(make-instance-instance.1"
" bulk-binding-registry57_0"
" insp56_0"
" ns53_0"
" phase-shift54_0"
" self55_0"
" temp58_0))))"
" bulk-binding-registry58_0"
" insp57_0"
" ns54_0"
" phase-shift55_0"
" self56_0"
" temp59_0))))"
"(let-values(((syntax-literals-instance_0)"
"(if syntax-literals-linklet_0"
"(1/instantiate-linklet"
@ -38627,8 +38625,8 @@ static const char *startup_source =
"(promise1.1"
"(lambda()"
"(shift-to-inside-root-context"
"(let-values(((self59_0) self_0))"
"(make-root-expand-context.1 #f null unsafe-undefined unsafe-undefined self59_0))))"
"(let-values(((self60_0) self_0))"
"(make-root-expand-context.1 #f null unsafe-undefined unsafe-undefined self60_0))))"
" #f)))"
"(if(procedure? get-encoded-root-expand-ctx_0)"
"(let-values()"
@ -42016,6 +42014,7 @@ static const char *startup_source =
" #f"
" #f"
" #f"
" #f"
" ns-140_0))"
"(let-values()"
"(instantiate_0"
@ -44268,6 +44267,8 @@ static const char *startup_source =
"(expand-context/inner-normalize-locals?"
" the-struct_1)"
"(expand-context/inner-should-not-encounter-macros?"
" the-struct_1)"
"(expand-context/inner-skip-visit-available?"
" the-struct_1)))"
"(raise-argument-error"
" 'struct-copy"
@ -44469,7 +44470,8 @@ static const char *startup_source =
"(expand-context/inner-for-serializable? the-struct_1)"
"(expand-context/inner-to-correlated-linklet? the-struct_1)"
"(expand-context/inner-normalize-locals? the-struct_1)"
"(expand-context/inner-should-not-encounter-macros? the-struct_1)))"
"(expand-context/inner-should-not-encounter-macros? the-struct_1)"
"(expand-context/inner-skip-visit-available? the-struct_1)))"
" (raise-argument-error 'struct-copy \"expand-context/inner?\" the-struct_1)))))"
"(expand-context/outer1.1"
" inner220_0"
@ -45954,7 +45956,8 @@ static const char *startup_source =
"(expand-context/inner-to-correlated-linklet? the-struct_1)"
"(expand-context/inner-normalize-locals? the-struct_1)"
"(expand-context/inner-should-not-encounter-macros?"
" the-struct_1)))"
" the-struct_1)"
"(expand-context/inner-skip-visit-available? the-struct_1)))"
"(raise-argument-error"
" 'struct-copy"
" \"expand-context/inner?\""
@ -49669,6 +49672,7 @@ static const char *startup_source =
"(make-expand-context.1"
" serializable?110_0"
" observer112_0"
" #f"
" to-correlated-linklet?111_0"
" to-parsed?109_0"
" ns108_0))))"
@ -49765,7 +49769,8 @@ static const char *startup_source =
"(let-values(((require-lifts_0 lifts_0 exp-s_0)"
"(expand-capturing-lifts"
" s_0"
"(let-values(((v_0)(let-values(((ns138_0) ns_0))(make-expand-context.1 #f #f #f #f ns138_0))))"
"(let-values(((v_0)"
"(let-values(((ns138_0) ns_0))(make-expand-context.1 #f #f #f #f #f ns138_0))))"
"(let-values(((the-struct_0) v_0))"
"(if(expand-context/outer? the-struct_0)"
"(let-values(((inner139_0)"
@ -49800,7 +49805,8 @@ static const char *startup_source =
"(expand-context/inner-for-serializable? the-struct_1)"
"(expand-context/inner-to-correlated-linklet? the-struct_1)"
"(expand-context/inner-normalize-locals? the-struct_1)"
"(expand-context/inner-should-not-encounter-macros? the-struct_1)))"
"(expand-context/inner-should-not-encounter-macros? the-struct_1)"
"(expand-context/inner-skip-visit-available? the-struct_1)))"
"(raise-argument-error"
" 'struct-copy"
" \"expand-context/inner?\""
@ -49892,7 +49898,7 @@ static const char *startup_source =
"(let-values(((s_0)(maybe-intro given-s_0 ns_0)))"
"(let-values(((ctx_0)"
"(let-values(((ns149_0) ns_0)((observer150_0) observer_0))"
"(make-expand-context.1 #f observer150_0 #f #f ns149_0))))"
"(make-expand-context.1 #f observer150_0 #f #f #f ns149_0))))"
"(let-values(((phase_0)(namespace-phase ns_0)))"
"((letrec-values(((loop_0)"
"(lambda(s_1 phase_1 ns_1 as-tail?_0)"
@ -49968,6 +49974,8 @@ static const char *startup_source =
"(expand-context/inner-normalize-locals?"
" the-struct_1)"
"(expand-context/inner-should-not-encounter-macros?"
" the-struct_1)"
"(expand-context/inner-skip-visit-available?"
" the-struct_1)))"
"(raise-argument-error"
" 'struct-copy"
@ -50090,6 +50098,8 @@ static const char *startup_source =
"(expand-context/inner-normalize-locals?"
" the-struct_1)"
"(expand-context/inner-should-not-encounter-macros?"
" the-struct_1)"
"(expand-context/inner-skip-visit-available?"
" the-struct_1)))"
"(raise-argument-error"
" 'struct-copy"
@ -50622,6 +50632,8 @@ static const char *startup_source =
"(expand-context/inner-normalize-locals?"
" the-struct_1)"
"(expand-context/inner-should-not-encounter-macros?"
" the-struct_1)"
"(expand-context/inner-skip-visit-available?"
" the-struct_1)))"
"(raise-argument-error"
" 'struct-copy"
@ -63380,9 +63392,12 @@ static const char *startup_source =
" current-expand-context"
" #f"
"(let-values()"
"(if(expand-context-skip-visit-available? ctx_0)"
"(void)"
"(let-values()"
"(namespace-visit-available-modules!"
"(expand-context-namespace ctx_0)"
" phase_0)))"
" phase_0)))))"
"(values))))"
"(let-values((()"
"(begin"
@ -75477,6 +75492,8 @@ static const char *startup_source =
"(expand-context/inner-normalize-locals?"
" the-struct_1)"
"(expand-context/inner-should-not-encounter-macros?"
" the-struct_1)"
"(expand-context/inner-skip-visit-available?"
" the-struct_1)))"
"(raise-argument-error"
" 'struct-copy"
@ -76523,7 +76540,8 @@ static const char *startup_source =
"(expand-context/inner-for-serializable? the-struct_1)"
"(expand-context/inner-to-correlated-linklet? the-struct_1)"
"(expand-context/inner-normalize-locals? the-struct_1)"
"(expand-context/inner-should-not-encounter-macros? the-struct_1)))"
"(expand-context/inner-should-not-encounter-macros? the-struct_1)"
"(expand-context/inner-skip-visit-available? the-struct_1)))"
" (raise-argument-error 'struct-copy \"expand-context/inner?\" the-struct_1)))))"
"(expand-context/outer1.1"
" inner198_0"
@ -76891,6 +76909,8 @@ static const char *startup_source =
"(expand-context/inner-normalize-locals?"
" the-struct_1)"
"(expand-context/inner-should-not-encounter-macros?"
" the-struct_1)"
"(expand-context/inner-skip-visit-available?"
" the-struct_1)))"
"(raise-argument-error"
" 'struct-copy"
@ -77323,6 +77343,8 @@ static const char *startup_source =
"(expand-context/inner-normalize-locals?"
" the-struct_1)"
"(expand-context/inner-should-not-encounter-macros?"
" the-struct_1)"
"(expand-context/inner-skip-visit-available?"
" the-struct_1)))"
"(raise-argument-error"
" 'struct-copy"
@ -77592,6 +77614,8 @@ static const char *startup_source =
"(expand-context/inner-normalize-locals?"
" the-struct_1)"
"(expand-context/inner-should-not-encounter-macros?"
" the-struct_1)"
"(expand-context/inner-skip-visit-available?"
" the-struct_1)))"
"(raise-argument-error"
" 'struct-copy"
@ -77780,6 +77804,8 @@ static const char *startup_source =
"(expand-context/inner-normalize-locals?"
" the-struct_1)"
"(expand-context/inner-should-not-encounter-macros?"
" the-struct_1)"
"(expand-context/inner-skip-visit-available?"
" the-struct_1)))"
"(raise-argument-error"
" 'struct-copy"
@ -78025,6 +78051,8 @@ static const char *startup_source =
"(expand-context/inner-normalize-locals?"
" the-struct_1)"
"(expand-context/inner-should-not-encounter-macros?"
" the-struct_1)"
"(expand-context/inner-skip-visit-available?"
" the-struct_1)))"
"(raise-argument-error"
" 'struct-copy"
@ -78252,6 +78280,8 @@ static const char *startup_source =
"(expand-context/inner-normalize-locals?"
" the-struct_1)"
"(expand-context/inner-should-not-encounter-macros?"
" the-struct_1)"
"(expand-context/inner-skip-visit-available?"
" the-struct_1)))"
"(raise-argument-error"
" 'struct-copy"
@ -80045,6 +80075,8 @@ static const char *startup_source =
"(expand-context/inner-normalize-locals?"
" the-struct_1)"
"(expand-context/inner-should-not-encounter-macros?"
" the-struct_1)"
"(expand-context/inner-skip-visit-available?"
" the-struct_1)))"
"(raise-argument-error"
" 'struct-copy"
@ -81590,6 +81622,8 @@ static const char *startup_source =
"(expand-context/inner-normalize-locals?"
" the-struct_1)"
"(expand-context/inner-should-not-encounter-macros?"
" the-struct_1)"
"(expand-context/inner-skip-visit-available?"
" the-struct_1)))"
"(raise-argument-error"
" 'struct-copy"
@ -82647,6 +82681,8 @@ static const char *startup_source =
"(expand-context/inner-normalize-locals?"
" the-struct_1)"
"(expand-context/inner-should-not-encounter-macros?"
" the-struct_1)"
"(expand-context/inner-skip-visit-available?"
" the-struct_1)))"
"(raise-argument-error"
" 'struct-copy"
@ -83520,7 +83556,8 @@ static const char *startup_source =
"(expand-context/inner-to-correlated-linklet? the-struct_1)"
"(expand-context/inner-normalize-locals? the-struct_1)"
"(expand-context/inner-should-not-encounter-macros?"
" the-struct_1)))"
" the-struct_1)"
"(expand-context/inner-skip-visit-available? the-struct_1)))"
"(raise-argument-error"
" 'struct-copy"
" \"expand-context/inner?\""