syntax-quote, *listname-registry*

This commit is contained in:
ESL 2024-07-06 13:13:44 -04:00
parent 23f278f767
commit ab334f4813
2 changed files with 111 additions and 90 deletions

View file

@ -208,7 +208,7 @@
; These names are bound to specials never returned by xform: ; These names are bound to specials never returned by xform:
; (syntax <value>) ; (syntax-quote <value>)
; (body <expr or def> ...) ; (body <expr or def> ...)
; (syntax-lambda (<id> ...) <expr>) ; (syntax-lambda (<id> ...) <expr>)
; (syntax-rules (<id> ...) <rule> ...) ; (syntax-rules (<id> ...) <rule> ...)
@ -262,7 +262,7 @@
; <location> -> #&<value> ; <location> -> #&<value>
; <value> -> <special> | <core> ; <value> -> <special> | <core>
; <special> -> <builtin> | <integrable> | <transformer> ; <special> -> <builtin> | <integrable> | <transformer>
; <builtin> -> syntax | quote | set! | set& | if | lambda | lambda* | ; <builtin> -> syntax-quote | quote | set! | set& | if | lambda | lambda* |
; letcc | withcc | body | begin | define | define-syntax | ; letcc | withcc | body | begin | define | define-syntax |
; syntax-lambda | syntax-rules | syntax-length | syntax-error ; syntax-lambda | syntax-rules | syntax-length | syntax-error
; <integrable> -> <fixnum serving as index in internal integrables table> ; <integrable> -> <fixnum serving as index in internal integrables table>
@ -328,11 +328,11 @@
(define (check-syntax sexp pat msg) (define (check-syntax sexp pat msg)
(unless (sexp-match? pat sexp) (x-error msg sexp))) (unless (sexp-match? pat sexp) (x-error msg sexp)))
(define syntax-id (new-id 'syntax (make-location 'syntax) #f))
(define lambda-id (new-id 'lambda (make-location 'lambda) #f)) (define lambda-id (new-id 'lambda (make-location 'lambda) #f))
(define begin-id (new-id 'begin (make-location 'begin) #f)) (define begin-id (new-id 'begin (make-location 'begin) #f))
(define define-id (new-id 'define (make-location 'define) #f)) (define define-id (new-id 'define (make-location 'define) #f))
(define define-syntax-id (new-id 'define-syntax (make-location 'define-syntax) #f)) (define define-syntax-id (new-id 'define-syntax (make-location 'define-syntax) #f))
(define syntax-quote-id (new-id 'syntax-quote (make-location 'syntax-quote) #f))
; xform receives Scheme s-expressions and returns either Core Scheme <core> ; xform receives Scheme s-expressions and returns either Core Scheme <core>
; (always a pair) or special-form, which is either a builtin (a symbol) or ; (always a pair) or special-form, which is either a builtin (a symbol) or
@ -355,7 +355,6 @@
[else [else
(let* ([head (car sexp)] [tail (cdr sexp)] [hval (xform #t head env)]) (let* ([head (car sexp)] [tail (cdr sexp)] [hval (xform #t head env)])
(case hval (case hval
[(syntax) (xform-syntax tail env)]
[(quote) (xform-quote tail env)] [(quote) (xform-quote tail env)]
[(set!) (xform-set! tail env)] [(set!) (xform-set! tail env)]
[(set&) (xform-set& tail env)] [(set&) (xform-set& tail env)]
@ -368,6 +367,7 @@
[(begin) (xform-begin tail env appos?)] [(begin) (xform-begin tail env appos?)]
[(define) (xform-define tail env)] [(define) (xform-define tail env)]
[(define-syntax) (xform-define-syntax tail env)] [(define-syntax) (xform-define-syntax tail env)]
[(syntax-quote) (xform-syntax-quote tail env)]
[(syntax-lambda) (xform-syntax-lambda tail env appos?)] [(syntax-lambda) (xform-syntax-lambda tail env appos?)]
[(syntax-rules) (xform-syntax-rules tail env)] [(syntax-rules) (xform-syntax-rules tail env)]
[(syntax-length) (xform-syntax-length tail env)] [(syntax-length) (xform-syntax-length tail env)]
@ -380,11 +380,6 @@
(xform appos? (hval sexp env) env) (xform appos? (hval sexp env) env)
(xform-call hval tail env)))]))])) (xform-call hval tail env)))]))]))
(define (xform-syntax tail env)
(if (list1? tail)
(car tail) ; must be <core>, todo: check?
(x-error "improper syntax form" (cons 'syntax tail))))
(define (xform-quote tail env) (define (xform-quote tail env)
(if (list1? tail) (if (list1? tail)
(list 'quote (xform-sexp->datum (car tail))) (list 'quote (xform-sexp->datum (car tail)))
@ -581,16 +576,21 @@
(list 'define-syntax (id->sym (car tail)) (xform #t (cadr tail) env)) (list 'define-syntax (id->sym (car tail)) (xform #t (cadr tail) env))
(x-error "improper define-syntax form" (cons 'define-syntax tail)))) (x-error "improper define-syntax form" (cons 'define-syntax tail))))
(define (xform-syntax-quote tail env)
(if (list1? tail)
(car tail) ; must be <core>, todo: check?
(x-error "improper syntax-quote form" (cons 'syntax-quote tail))))
(define (xform-syntax-lambda tail env appos?) (define (xform-syntax-lambda tail env appos?)
(if (and (list2+? tail) (andmap id? (car tail))) (if (and (list2+? tail) (andmap id? (car tail)))
(let ([vars (car tail)] [macenv env] [forms (cdr tail)]) (let ([vars (car tail)] [macenv env] [forms (cdr tail)])
; return a transformer that wraps xformed body in (syntax ...) ; return a transformer that wraps xformed body in (syntax-quote ...)
; to make sure xform treats it as final <core> form and exits the loop ; to make sure xform treats it as final <core> form and exits the loop
(lambda (use useenv) (lambda (use useenv)
(if (and (list1+? use) (fx=? (length vars) (length (cdr use)))) (if (and (list1+? use) (fx=? (length vars) (length (cdr use))))
(let loop ([vars vars] [exps (cdr use)] [env macenv]) (let loop ([vars vars] [exps (cdr use)] [env macenv])
(if (null? vars) (if (null? vars)
(list syntax-id (xform-body forms env appos?)) (list syntax-quote-id (xform-body forms env appos?))
(loop (cdr vars) (cdr exps) (loop (cdr vars) (cdr exps)
(extend-xenv-local (car vars) (extend-xenv-local (car vars)
(xform #t (car exps) useenv) env)))) (xform #t (car exps) useenv) env))))
@ -868,8 +868,7 @@
(let ([ic&ex (preprocess-library s env)]) (let ([ic&ex (preprocess-library s env)])
(return (car ic&ex) (cdr ic&ex)))] (return (car ic&ex) (cdr ic&ex)))]
[(and (list1+? s) (andmap libpart? s)) [(and (list1+? s) (andmap libpart? s))
(let* ([lib (xform-sexp->datum s)] (let* ([lib (xform-sexp->datum s)] [sym (listname->symbol lib)]
[sym (if (symbol? lib) lib (listname->symbol lib))]
[core (xform #f sym env)]) ; #f to run id-syntax (in mac-env?) [core (xform #f sym env)]) ; #f to run id-syntax (in mac-env?)
(check-syntax core '(quote ((<symbol> * ...) (<symbol> . *) ...)) (check-syntax core '(quote ((<symbol> * ...) (<symbol> . *) ...))
"library import set does not refer to a valid library") "library import set does not refer to a valid library")
@ -1639,6 +1638,9 @@
; Library names and library file lookup ; Library names and library file lookup
;--------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------
(define (lnpart? x) (or (id? x) (exact-integer? x)))
(define (listname? x) (and (list1+? x) (andmap lnpart? x)))
(define (mangle-symbol->string sym) (define (mangle-symbol->string sym)
(define safe '(#\! #\$ #\- #\_ #\=)) (define safe '(#\! #\$ #\- #\_ #\=))
(let loop ([lst (string->list (symbol->string sym))] [text '()]) (let loop ([lst (string->list (symbol->string sym))] [text '()])
@ -1844,7 +1846,6 @@
(define-in-root-environment! 'cond-expand (define-in-root-environment! 'cond-expand
(make-location (make-cond-expand-transformer)) #t) (make-location (make-cond-expand-transformer)) #t)
; now put the builtins (lazily) and others ; now put the builtins (lazily) and others
(let ([put! (lambda (k loc) (define-in-root-environment! k loc #t))]) (let ([put! (lambda (k loc) (define-in-root-environment! k loc #t))])
@ -1870,19 +1871,29 @@
(define (root-environment id at) (define (root-environment id at)
(env-lookup id *root-environment* at)) (env-lookup id *root-environment* at))
;--------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------
; Library registry and built-in libraries ; List-name registry and built-in libraries
;--------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------
(define *library-registry* '()) ; alist of a form ((libsym . ic&ex) ...) (define *listname-registry* '()) ; alist of a form ((listname . <location>) ...)
(define (library-info lib alloc?) ;=> (code . eal) | #f (define (listname-lookup listname alloc?) ;=> <location> | #f
(let ([key (if (symbol? lib) lib (listname->symbol lib))]) (cond [(assoc listname *listname-registry*) => cdr]
(cond [(assq key *library-registry*) => cdr] [(not alloc?) #f]
[(not alloc?) #f] [else (let ([loc (make-location '(undefined))])
[else (let ([ic&ex (cons '(begin) '())]) (set! *listname-registry* (cons (cons listname loc) *listname-registry*))
(set! *library-registry* (cons (cons key ic&ex) *library-registry*)) loc)]))
ic&ex)])))
; specialized version for libraries
(define (library-info listname alloc?) ;=> ic&ex | #f
(let ([loc (listname-lookup listname alloc?)])
(and loc
(let* ([v (location-val loc)] [q? (and (pair? v) (eq? (car v) 'quote))])
(if q? (cadr v)
(let ([ic&ex (cons '(begin) '())])
(location-set-val! loc (list 'quote ic&ex))
ic&ex))))))
(for-each (for-each
(lambda (r) (lambda (r)
@ -1971,15 +1982,13 @@
; add std libraries to root env as expand time mappings of library's symbolic name ; add std libraries to root env as expand time mappings of library's symbolic name
; to an identifyer-syntax expanding into (quote (<init-code> . <eal>)) form ; to an identifyer-syntax expanding into (quote (<init-code> . <eal>)) form
; NB: later, this will need to be done via auto-allocating denotations! ; NB: later, this will need to be done via auto-allocating denotations!
(let ([syntax-id (new-id 'syntax (make-location 'syntax) #f)]) (for-each
(for-each (lambda (p) ; we can rely on the fact that p is (listname . #&(quote ic&ex))
(lambda (p) (let* ([listname (car p)] [val (location-val (cdr p))])
(let* ([sym (car p)] [ic&ex (cdr p)]) (define (libid-transformer sexp env) (list syntax-quote-id val))
(define (libid-transformer sexp env) (define-in-root-environment! (listname->symbol listname)
(list syntax-id (list 'quote ic&ex))) (make-location libid-transformer) #t)))
(define-in-root-environment! sym *listname-registry*)
(make-location libid-transformer) #t)))
*library-registry*))
@ -2042,7 +2051,7 @@
(let* ([core (xform-define-library (car x) (cdr x) env #f)] (let* ([core (xform-define-library (car x) (cdr x) env #f)]
[loc (xenv-lookup env (cadr core) 'define-syntax)]) [loc (xenv-lookup env (cadr core) 'define-syntax)])
(if loc ; location or #f (if loc ; location or #f
(let* ([qie (caddr core)] [val (lambda (sexp env) (list syntax-id qie))]) (let* ([qie (caddr core)] [val (lambda (sexp env) (list syntax-quote-id qie))])
(location-set-val! loc val)) ; wrapped in identifier-syntax transformer (location-set-val! loc val)) ; wrapped in identifier-syntax transformer
(x-error "identifier cannot be (re)defined as syntax in env:" (x-error "identifier cannot be (re)defined as syntax in env:"
(cadr core) env)) (cadr core) env))
@ -2051,7 +2060,8 @@
(let* ([core (xform-import (car x) (cdr x) env #f)] ; core is (import (quote ic&ex)) (let* ([core (xform-import (car x) (cdr x) env #f)] ; core is (import (quote ic&ex))
[ic&ex (cadadr core)] [code (car ic&ex)] [eal (cdr ic&ex)]) [ic&ex (cadadr core)] [code (car ic&ex)] [eal (cdr ic&ex)])
(define (define-alias p) (define (define-alias p)
(repl-eval-top-form (list define-syntax-id (car p) (list syntax-id (location-val (cdr p)))) env)) (repl-eval-top-form
(list define-syntax-id (car p) (list syntax-quote-id (location-val (cdr p)))) env))
(repl-compile-and-run-core-expr code) (repl-compile-and-run-core-expr code)
(for-each define-alias eal))] (for-each define-alias eal))]
[(procedure? hval) ; transformer: apply and loop [(procedure? hval) ; transformer: apply and loop

123
t.c
View file

@ -190,9 +190,6 @@ char *t_code[] = {
"P", "check-syntax", "P", "check-syntax",
"%3${.2,.4,@(y11:sexp-match?)[02}~?{.0,.3,@(y7:x-error)[32}]3", "%3${.2,.4,@(y11:sexp-match?)[02}~?{.0,.3,@(y7:x-error)[32}]3",
"C", 0,
"${f,'(y6:syntax)b,'(y6:syntax),@(y6:new-id)[03}@!(y9:syntax-id)",
"C", 0, "C", 0,
"${f,'(y6:lambda)b,'(y6:lambda),@(y6:new-id)[03}@!(y9:lambda-id)", "${f,'(y6:lambda)b,'(y6:lambda),@(y6:new-id)[03}@!(y9:lambda-id)",
@ -206,31 +203,31 @@ char *t_code[] = {
"${f,'(y13:define-syntax)b,'(y13:define-syntax),@(y6:new-id)[03}@!(y16:" "${f,'(y13:define-syntax)b,'(y13:define-syntax),@(y6:new-id)[03}@!(y16:"
"define-syntax-id)", "define-syntax-id)",
"C", 0,
"${f,'(y12:syntax-quote)b,'(y12:syntax-quote),@(y6:new-id)[03}@!(y15:sy"
"ntax-quote-id)",
"P", "xform", "P", "xform",
"%3${.3,@(y3:id?)[01}?{${.4,.4,@(y9:xform-ref)[02},.1?{.0]4}.0U0?{.0U7," "%3${.3,@(y3:id?)[01}?{${.4,.4,@(y9:xform-ref)[02},.1?{.0]4}.0U0?{.0U7,"
"'(y3:ref),l2]4}.0K0?{.3,${.6,.6,.5[02},.3,@(y5:xform)[43}.0p~?{.0,'(s2" "'(y3:ref),l2]4}.0K0?{.3,${.6,.6,.5[02},.3,@(y5:xform)[43}.0p~?{.0,'(s2"
"7:improper use of syntax form),@(y7:x-error)[42}.0]4}.1p~?{.2,.2,l1,@(" "7:improper use of syntax form),@(y7:x-error)[42}.0]4}.1p~?{.2,.2,l1,@("
"y11:xform-quote)[32}.1a,.2d,${.6,.4,t,@(y5:xform)[03},.0,'(y6:syntax)," "y11:xform-quote)[32}.1a,.2d,${.6,.4,t,@(y5:xform)[03},.0,'(y5:quote),."
".1v?{.6,.3,@(y12:xform-syntax)[72}'(y5:quote),.1v?{.6,.3,@(y11:xform-q" "1v?{.6,.3,@(y11:xform-quote)[72}'(y4:set!),.1v?{.6,.3,@(y10:xform-set!"
"uote)[72}'(y4:set!),.1v?{.6,.3,@(y10:xform-set!)[72}'(y4:set&),.1v?{.6" ")[72}'(y4:set&),.1v?{.6,.3,@(y10:xform-set&)[72}'(y2:if),.1v?{.6,.3,@("
",.3,@(y10:xform-set&)[72}'(y2:if),.1v?{.6,.3,@(y8:xform-if)[72}'(y6:la" "y8:xform-if)[72}'(y6:lambda),.1v?{.6,.3,@(y12:xform-lambda)[72}'(y7:la"
"mbda),.1v?{.6,.3,@(y12:xform-lambda)[72}'(y7:lambda*),.1v?{.6,.3,@(y13" "mbda*),.1v?{.6,.3,@(y13:xform-lambda*)[72}'(y5:letcc),.1v?{.6,.3,@(y11"
":xform-lambda*)[72}'(y5:letcc),.1v?{.6,.3,@(y11:xform-letcc)[72}'(y6:w" ":xform-letcc)[72}'(y6:withcc),.1v?{.6,.3,@(y12:xform-withcc)[72}'(y4:b"
"ithcc),.1v?{.6,.3,@(y12:xform-withcc)[72}'(y4:body),.1v?{.4,.7,.4,@(y1" "ody),.1v?{.4,.7,.4,@(y10:xform-body)[73}'(y5:begin),.1v?{.4,.7,.4,@(y1"
"0:xform-body)[73}'(y5:begin),.1v?{.4,.7,.4,@(y11:xform-begin)[73}'(y6:" "1:xform-begin)[73}'(y6:define),.1v?{.6,.3,@(y12:xform-define)[72}'(y13"
"define),.1v?{.6,.3,@(y12:xform-define)[72}'(y13:define-syntax),.1v?{.6" ":define-syntax),.1v?{.6,.3,@(y19:xform-define-syntax)[72}'(y12:syntax-"
",.3,@(y19:xform-define-syntax)[72}'(y13:syntax-lambda),.1v?{.4,.7,.4,@" "quote),.1v?{.6,.3,@(y18:xform-syntax-quote)[72}'(y13:syntax-lambda),.1"
"(y19:xform-syntax-lambda)[73}'(y12:syntax-rules),.1v?{.6,.3,@(y18:xfor" "v?{.4,.7,.4,@(y19:xform-syntax-lambda)[73}'(y12:syntax-rules),.1v?{.6,"
"m-syntax-rules)[72}'(y13:syntax-length),.1v?{.6,.3,@(y19:xform-syntax-" ".3,@(y18:xform-syntax-rules)[72}'(y13:syntax-length),.1v?{.6,.3,@(y19:"
"length)[72}'(y12:syntax-error),.1v?{.6,.3,@(y18:xform-syntax-error)[72" "xform-syntax-length)[72}'(y12:syntax-error),.1v?{.6,.3,@(y18:xform-syn"
"}'(y14:define-library),.1v?{.4,.7,.4,.6,@(y20:xform-define-library)[74" "tax-error)[72}'(y14:define-library),.1v?{.4,.7,.4,.6,@(y20:xform-defin"
"}'(y6:import),.1v?{.4,.7,.4,.6,@(y12:xform-import)[74}.1U0?{.6,.3,.3,@" "e-library)[74}'(y6:import),.1v?{.4,.7,.4,.6,@(y12:xform-import)[74}.1U"
"(y16:xform-integrable)[73}.1K0?{.6,${.9,.9,.6[02},.6,@(y5:xform)[73}.6" "0?{.6,.3,.3,@(y16:xform-integrable)[73}.1K0?{.6,${.9,.9,.6[02},.6,@(y5"
",.3,.3,@(y10:xform-call)[73", ":xform)[73}.6,.3,.3,@(y10:xform-call)[73",
"P", "xform-syntax",
"%2${.2,@(y6:list1?)[01}?{.0a]2}.0,'(y6:syntax)c,'(s20:improper syntax "
"form),@(y7:x-error)[22",
"P", "xform-quote", "P", "xform-quote",
"%2${.2,@(y6:list1?)[01}?{${.2a,@(y17:xform-sexp->datum)[01},'(y5:quote" "%2${.2,@(y6:list1?)[01}?{${.2a,@(y17:xform-sexp->datum)[01},'(y5:quote"
@ -356,14 +353,18 @@ char *t_code[] = {
"rm)[03},${.3a,@(y7:id->sym)[01},'(y13:define-syntax),l3]2}.0,'(y13:def" "rm)[03},${.3a,@(y7:id->sym)[01},'(y13:define-syntax),l3]2}.0,'(y13:def"
"ine-syntax)c,'(s27:improper define-syntax form),@(y7:x-error)[22", "ine-syntax)c,'(s27:improper define-syntax form),@(y7:x-error)[22",
"P", "xform-syntax-quote",
"%2${.2,@(y6:list1?)[01}?{.0a]2}.0,'(y12:syntax-quote)c,'(s26:improper "
"syntax-quote form),@(y7:x-error)[22",
"P", "xform-syntax-lambda", "P", "xform-syntax-lambda",
"%3${.2,@(y7:list2+?)[01}?{${.2a,@(y3:id?),@(y6:andmap)[02}}{f}?{.0d,.2" "%3${.2,@(y7:list2+?)[01}?{${.2a,@(y3:id?),@(y6:andmap)[02}}{f}?{.0d,.2"
",.2a,.5,.3,.2,.4,&4{%2${.2,@(y7:list1+?)[01}?{.0dg,:1gI=}{f}?{:0,.1d,:" ",.2a,.5,.3,.2,.4,&4{%2${.2,@(y7:list1+?)[01}?{.0dg,:1gI=}{f}?{:0,.1d,:"
"1,,#0.5,.1,:3,:2,&4{%3.0u?{${:1,.5,:0,@(y10:xform-body)[03},@(y9:synta" "1,,#0.5,.1,:3,:2,&4{%3.0u?{${:1,.5,:0,@(y10:xform-body)[03},@(y15:synt"
"x-id),l2]3}${.4,${:3,.7a,t,@(y5:xform)[03},.4a,@(y17:extend-xenv-local" "ax-quote-id),l2]3}${.4,${:3,.7a,t,@(y5:xform)[03},.4a,@(y17:extend-xen"
")[03},.2d,.2d,:2^[33}.!0.0^_1[23}.0,'(s33:invalid syntax-lambda applic" "v-local)[03},.2d,.2d,:2^[33}.!0.0^_1[23}.0,'(s33:invalid syntax-lambda"
"ation),@(y7:x-error)[22}]6}.0,'(y13:syntax-lambda)c,'(s27:improper syn" " application),@(y7:x-error)[22}]6}.0,'(y13:syntax-lambda)c,'(s27:impro"
"tax-lambda body),@(y7:x-error)[32", "per syntax-lambda body),@(y7:x-error)[32",
"P", "xform-syntax-rules", "P", "xform-syntax-rules",
"%2${.2,@(y7:list2+?)[01}?{${.2a,@(y3:id?)[01}?{${.2da,@(y3:id?),@(y6:a" "%2${.2,@(y7:list2+?)[01}?{${.2a,@(y3:id?)[01}?{${.2da,@(y3:id?),@(y6:a"
@ -488,14 +489,14 @@ char *t_code[] = {
",.5d,:0^[02},.3ad,.2dacc]4}${.4,.4d,:0^[02},.2ac]3}.!0.0^_1[02},.1,:0[" ",.5d,:0^[02},.3ad,.2dacc]4}${.4,.4d,:0^[02},.2ac]3}.!0.0^_1[02},.1,:0["
"22},.2da,:5^[32}${.3,@(y7:list2+?)[01}?{:6,.2aq}{f}?{${:8,.4,@(y18:pre" "22},.2da,:5^[32}${.3,@(y7:list2+?)[01}?{:6,.2aq}{f}?{${:8,.4,@(y18:pre"
"process-library)[02},.0d,.1a,.5[42}${.3,@(y7:list1+?)[01}?{${.3,:7^,@(" "process-library)[02},.0d,.1a,.5[42}${.3,@(y7:list1+?)[01}?{${.3,:7^,@("
"y6:andmap)[02}}{f}?{${.3,@(y17:xform-sexp->datum)[01},.0Y0?{.0}{${.2,@" "y6:andmap)[02}}{f}?{${.3,@(y17:xform-sexp->datum)[01},${.2,@(y16:listn"
"(y16:listname->symbol)[01}},${:8,.3,f,@(y5:xform)[03},${'(s52:library " "ame->symbol)[01},${:8,.3,f,@(y5:xform)[03},${'(s52:library import set "
"import set does not refer to a valid library),'(l2:y5:quote;l3:l3:y8:<" "does not refer to a valid library),'(l2:y5:quote;l3:l3:y8:<symbol>;y1:"
"symbol>;y1:*;y3:...;;py8:<symbol>;y1:*;;y3:...;;),.4,@(y12:check-synta" "*;y3:...;;py8:<symbol>;y1:*;;y3:...;;),.4,@(y12:check-syntax)[03}.0dad"
"x)[03}.0dad,.1daa,.7[62}.1,'(s28:invalid import set in import),@(y7:x-" ",.1daa,.7[62}.1,'(s28:invalid import set in import),@(y7:x-error)[32}."
"error)[32}.!0n,'(l1:y5:begin;),.(i11)d,,#0.0,.5,&2{%3.0u?{.2,.2c]3}.2," "!0n,'(l1:y5:begin;),.(i11)d,,#0.0,.5,&2{%3.0u?{.2,.2c]3}.2,.2,.2,:1,&4"
".2,.2,:1,&4{%2${:3,.4,@(y11:adjoin-eals)[02},${.3,:2,@(y11:adjoin-code" "{%2${:3,.4,@(y11:adjoin-eals)[02},${.3,:2,@(y11:adjoin-code)[02},:1d,:"
")[02},:1d,:0^[23},.1a,:0^[32}.!0.0^_1[(i11)3", "0^[23},.1a,:0^[32}.!0.0^_1[(i11)3",
"P", "preprocess-library-declarations", "P", "preprocess-library-declarations",
"%2${'(s35:invalid library declarations syntax),'(l3:y4:<id>;l3:y4:<id>" "%2${'(s35:invalid library declarations syntax),'(l3:y4:<id>;l3:y4:<id>"
@ -886,6 +887,12 @@ char *t_code[] = {
"(y14:path-directory)[01},.2,@(y34:file-resolve-relative-to-base-path)[" "(y14:path-directory)[01},.2,@(y34:file-resolve-relative-to-base-path)["
"22}.1]2}.0]1", "22}.1]2}.0]1",
"P", "lnpart?",
"%1${.2,@(y3:id?)[01},.0?{.0]2}.1I0]2",
"P", "listname?",
"%1${.2,@(y7:list1+?)[01}?{.0,@(y7:lnpart?),@(y6:andmap)[12}f]1",
"P", "mangle-symbol->string", "P", "mangle-symbol->string",
"%1,#0'(l5:c!;c$;c-;c_;c=;).!0n,.2X4X2,,#0.0,.4,&2{%2.0u?{.1A8X3]2}.0aC" "%1,#0'(l5:c!;c$;c-;c_;c=;).!0n,.2X4X2,,#0.0,.4,&2{%2.0u?{.1A8X3]2}.0aC"
"2,.0?{.0}{.1aC5}_1?{.1,.1ac,.1d,:1^[22}:0^,.1aA1?{.1,.1ac,.1d,:1^[22}'" "2,.0?{.0}{.1aC5}_1?{.1,.1ac,.1d,:1^[22}:0^,.1aA1?{.1,.1ac,.1d,:1^[22}'"
@ -983,12 +990,15 @@ char *t_code[] = {
"%2.1,@(y18:*root-environment*),.2,@(y10:env-lookup)[23", "%2.1,@(y18:*root-environment*),.2,@(y10:env-lookup)[23",
"C", 0, "C", 0,
"n@!(y18:*library-registry*)", "n@!(y19:*listname-registry*)",
"P", "listname-lookup",
"%2@(y19:*listname-registry*),.1A5,.0?{.0d]3}.2~?{f]3}'(l1:y9:undefined"
";)b,@(y19:*listname-registry*),.1,.4cc@!(y19:*listname-registry*).0]4",
"P", "library-info", "P", "library-info",
"%2.0Y0?{.0}{${.2,@(y16:listname->symbol)[01}},@(y18:*library-registry*" "%2${.3,.3,@(y15:listname-lookup)[02},.0?{.0z,.0p?{'(y5:quote),.1aq}{f}"
"),.1A3,.0?{.0d]4}.3~?{f]4}n,'(l1:y5:begin;)c,@(y18:*library-registry*)" ",.0?{.1da]5}n,'(l1:y5:begin;)c,.0,'(y5:quote),l2,.4sz.0]6}f]3",
",.1,.4cc@!(y18:*library-registry*).0]5",
"C", 0, "C", 0,
"${'(l343:l3:y1:*;y1:v;y1:b;;l3:y1:+;y1:v;y1:b;;l3:y1:-;y1:v;y1:b;;l4:y" "${'(l343:l3:y1:*;y1:v;y1:b;;l3:y1:+;y1:v;y1:b;;l3:y1:-;y1:v;y1:b;;l4:y"
@ -1139,9 +1149,9 @@ char *t_code[] = {
"%25for-each1)[02}", "%25for-each1)[02}",
"C", 0, "C", 0,
"${f,'(y6:syntax)b,'(y6:syntax),@(y6:new-id)[03},${@(y18:*library-regis" "${@(y19:*listname-registry*),&0{%1.0a,.1dz,,#0.1,&1{%2:0,@(y15:syntax-"
"try*),.3,&1{%1.0a,.1d,,#0.1,:0,&2{%2:1,'(y5:quote),l2,:0,l2]2}.!0t,.1^" "quote-id),l2]2}.!0t,.1^b,${.6,@(y16:listname->symbol)[01},@(y27:define"
"b,.4,@(y27:define-in-root-environment!)[43},@(y10:%25for-each1)[02}_1", "-in-root-environment!)[43},@(y10:%25for-each1)[02}",
"C", 0, "C", 0,
"f@!(y9:*verbose*)", "f@!(y9:*verbose*)",
@ -1171,18 +1181,19 @@ char *t_code[] = {
"yntax in env:),@(y7:x-error)[03}}@(y9:*verbose*)?{Po,'(s18:SYNTAX INST" "yntax in env:),@(y7:x-error)[03}}@(y9:*verbose*)?{Po,'(s18:SYNTAX INST"
"ALLED: )W4Po,.2daW5PoW6]5}]5}'(y14:define-library),.1q?{${f,.5,.5d,.6a" "ALLED: )W4Po,.2daW5PoW6]5}]5}'(y14:define-library),.1q?{${f,.5,.5d,.6a"
",@(y20:xform-define-library)[04},${'(y13:define-syntax),.3da,.7,@(y11:" ",@(y20:xform-define-library)[04},${'(y13:define-syntax),.3da,.7,@(y11:"
"xenv-lookup)[03},.0?{.1dda,.0,&1{%2:0,@(y9:syntax-id),l2]2},.0,.3sz_1_" "xenv-lookup)[03},.0?{.1dda,.0,&1{%2:0,@(y15:syntax-quote-id),l2]2},.0,"
"1}{${.6,.4da,'(s50:identifier cannot be (re)defined as syntax in env:)" ".3sz_1_1}{${.6,.4da,'(s50:identifier cannot be (re)defined as syntax i"
",@(y7:x-error)[03}}@(y9:*verbose*)?{Po,'(s19:LIBRARY INSTALLED: )W4Po," "n env:),@(y7:x-error)[03}}@(y9:*verbose*)?{Po,'(s19:LIBRARY INSTALLED:"
".2daW5PoW6]5}]5}'(y6:import),.1q?{${f,.5,.5d,.6a,@(y12:xform-import)[0" " )W4Po,.2daW5PoW6]5}]5}'(y6:import),.1q?{${f,.5,.5d,.6a,@(y12:xform-im"
"4},.0dada,.0a,.1d,,#0.7,&1{%1:0,.1dz,@(y9:syntax-id),l2,.2a,@(y16:defi" "port)[04},.0dada,.0a,.1d,,#0.7,&1{%1:0,.1dz,@(y15:syntax-quote-id),l2,"
"ne-syntax-id),l3,@(y18:repl-eval-top-form)[12}.!0${.4,@(y30:repl-compi" ".2a,@(y16:define-syntax-id),l3,@(y18:repl-eval-top-form)[12}.!0${.4,@("
"le-and-run-core-expr)[01}.1,.1^,@(y10:%25for-each1)[82}.0K0?{.2,${.5,." "y30:repl-compile-and-run-core-expr)[01}.1,.1^,@(y10:%25for-each1)[82}."
"5,.5[02},@(y18:repl-eval-top-form)[32}.0U0?{${.4,.4d,.4,@(y16:xform-in" "0K0?{.2,${.5,.5,.5[02},@(y18:repl-eval-top-form)[32}.0U0?{${.4,.4d,.4,"
"tegrable)[03},@(y30:repl-compile-and-run-core-expr)[31}.0Y0?{${.4,.4,f" "@(y16:xform-integrable)[03},@(y30:repl-compile-and-run-core-expr)[31}."
",@(y5:xform)[03},@(y30:repl-compile-and-run-core-expr)[31}${.4,.4d,.4," "0Y0?{${.4,.4,f,@(y5:xform)[03},@(y30:repl-compile-and-run-core-expr)[3"
"@(y10:xform-call)[03},@(y30:repl-compile-and-run-core-expr)[31}${.3,.3" "1}${.4,.4d,.4,@(y10:xform-call)[03},@(y30:repl-compile-and-run-core-ex"
",f,@(y5:xform)[03},@(y30:repl-compile-and-run-core-expr)[21", "pr)[31}${.3,.3,f,@(y5:xform)[03},@(y30:repl-compile-and-run-core-expr)"
"[21",
"P", "repl-read", "P", "repl-read",
"%2.1?{PoW6Po,.2W4Po,'(s1: )W4}.0,@(y14:read-code-sexp)[21", "%2.1?{PoW6Po,.2W4Po,'(s1: )W4}.0,@(y14:read-code-sexp)[21",