mirror of
https://github.com/false-schemers/skint.git
synced 2024-12-26 21:58:51 +01:00
prelim work on newtop
This commit is contained in:
parent
9ac17ed824
commit
cf01f4d46e
2 changed files with 173 additions and 124 deletions
131
pre/t.scm
131
pre/t.scm
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
(load "s.scm")
|
(load "s.scm")
|
||||||
|
|
||||||
|
|
||||||
;--------------------------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------------------------
|
||||||
; Utils
|
; Utils
|
||||||
;--------------------------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------------------------
|
||||||
|
@ -157,7 +158,7 @@
|
||||||
|
|
||||||
|
|
||||||
;--------------------------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------------------------
|
||||||
; Syntax of the Scheme Core language
|
; Syntax of the 'Scheme Core' language
|
||||||
;--------------------------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
; <core> -> (quote <object>)
|
; <core> -> (quote <object>)
|
||||||
|
@ -229,6 +230,11 @@
|
||||||
; Macro transformer (from Scheme to Scheme Core) derived from Al Petrofsky's EIOD 1.17
|
; Macro transformer (from Scheme to Scheme Core) derived from Al Petrofsky's EIOD 1.17
|
||||||
;--------------------------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
; EIOD Copyright notice (amended with the author's permission):
|
||||||
|
; Copyright 2002, 2004, 2005 Al Petrofsky <al@petrofsky.org>
|
||||||
|
; LICENSING (3-clause BSD or GNU GPL 2 and up)
|
||||||
|
; <the text of the 3-clause BSD license is in the LICENSE file>
|
||||||
|
|
||||||
; An environment is a procedure that accepts any identifier and access type and returns a
|
; An environment is a procedure that accepts any identifier and access type and returns a
|
||||||
; denotation. Access type is one of these symbols: ref, set!, define, define-syntax.
|
; denotation. Access type is one of these symbols: ref, set!, define, define-syntax.
|
||||||
; The denotation of an identifier is its macro location, which is a cell storing the
|
; The denotation of an identifier is its macro location, which is a cell storing the
|
||||||
|
@ -292,13 +298,32 @@
|
||||||
(unless peek (x-error "env peek failed!" id env (id->sym id) (and (new-id? id) (new-id-lookup id 'peek))))
|
(unless peek (x-error "env peek failed!" id env (id->sym id) (and (new-id? id) (new-id-lookup id 'peek))))
|
||||||
(new-id (id->sym id) peek getlits))
|
(new-id (id->sym id) peek getlits))
|
||||||
|
|
||||||
|
; common code for consistency between two procedures below
|
||||||
|
; precondition: peek part of spg is a name registry; it is replaced by location
|
||||||
|
; containing (ref gs) value, where gs is a gensym derived from spg name part
|
||||||
|
(define (gensym-ref-value-helper def? spg)
|
||||||
|
; on top level, make sure the def? calling path should reach this procedure first!
|
||||||
|
(name-lookup (cadr spg) (car spg) (lambda (n) (list 'ref (if def? (gensym n) n)))))
|
||||||
|
|
||||||
; look up denotation of renamed identifier, trying to delay allocation up to the moment
|
; look up denotation of renamed identifier, trying to delay allocation up to the moment
|
||||||
; when actual location is needed -- peeks don't have to go all the way (see )
|
; when actual location is needed -- peeks don't have to go all the way (see )
|
||||||
(define (new-id-lookup id at)
|
(define (new-id-lookup id at)
|
||||||
(let* ([spg (id)] [peek (cadr spg)])
|
(let* ([spg (id)] [peek (cadr spg)])
|
||||||
(if (or (eq? at 'peek) (location? peek))
|
(if (or (eq? at 'peek) (location? peek))
|
||||||
peek ; delay binding allocation until absolutely necessary
|
peek ; delay binding allocation until absolutely necessary
|
||||||
(name-lookup peek (car spg) (lambda (n) (list 'ref n))))))
|
(gensym-ref-value-helper #f spg))))
|
||||||
|
|
||||||
|
; this operation should be consistent with new-id-lookup, but comes with a twist: if it is
|
||||||
|
; called with new-id and at=define/define-syntax, (env id at) is guaranteed to fail because
|
||||||
|
; renamed ids cannot be interned into name registries.
|
||||||
|
(define (top-defined-id-lookup env id at) ;=> loc | #f
|
||||||
|
(and (memq at '(define define-syntax))
|
||||||
|
(if (symbol? id) (xenv-lookup env id at)
|
||||||
|
(let* ([spg (id)] [peek (cadr spg)])
|
||||||
|
(if (location? peek)
|
||||||
|
peek ; loc is already there, use it
|
||||||
|
(gensym-ref-value-helper #t spg))))))
|
||||||
|
|
||||||
|
|
||||||
; Expand-time environments map names (identifiers or listnames) to denotations, i.e. locations
|
; Expand-time environments map names (identifiers or listnames) to denotations, i.e. locations
|
||||||
; containing either a <special> or a <core> value. In normal case, <core> value is (ref <gid>),
|
; containing either a <special> or a <core> value. In normal case, <core> value is (ref <gid>),
|
||||||
|
@ -374,7 +399,7 @@
|
||||||
[else hval]))]
|
[else hval]))]
|
||||||
[(not (pair? sexp))
|
[(not (pair? sexp))
|
||||||
(xform-quote (list sexp) env)]
|
(xform-quote (list sexp) env)]
|
||||||
[else
|
[else ; note: these transformations are made in 'expression' context
|
||||||
(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
|
||||||
[(quote) (xform-quote tail env)]
|
[(quote) (xform-quote tail env)]
|
||||||
|
@ -508,6 +533,19 @@
|
||||||
(xform-body (cdr tail) env) #f)
|
(xform-body (cdr tail) env) #f)
|
||||||
(x-error "improper withcc form" (cons 'withcc tail))))
|
(x-error "improper withcc form" (cons 'withcc tail))))
|
||||||
|
|
||||||
|
(define (preprocess-define head tail) ;=> (id sexp) or (sexp) for idless
|
||||||
|
(cond [(and (list2? tail) (null? (car tail))) (cdr tail)] ; idless
|
||||||
|
[(and (list2? tail) (id? (car tail))) tail] ; simple
|
||||||
|
[(and (list2+? tail) (pair? (car tail)) (id? (caar tail)) (idslist? (cdar tail)))
|
||||||
|
(list (caar tail) (cons lambda-id (cons (cdar tail) (cdr tail))))]
|
||||||
|
; TODO? here we can do full MIT-style define (arbitrarily nested)
|
||||||
|
[else (x-error "improper define form" (cons head tail))]))
|
||||||
|
|
||||||
|
(define (preprocess-define-syntax head tail) ;=> (id sexp)
|
||||||
|
(cond [(and (list2? tail) (id? (car tail))) tail] ; simple
|
||||||
|
; TODO? here we can do some fancy shortcuts or extensions
|
||||||
|
[else (x-error "improper define-syntax form" (cons head tail))]))
|
||||||
|
|
||||||
(define (xform-body tail env appos?)
|
(define (xform-body tail env appos?)
|
||||||
(cond
|
(cond
|
||||||
[(null? tail)
|
[(null? tail)
|
||||||
|
@ -527,24 +565,19 @@
|
||||||
(loop env ids inits nids (append tail rest))
|
(loop env ids inits nids (append tail rest))
|
||||||
(x-error "improper begin form" first))]
|
(x-error "improper begin form" first))]
|
||||||
[(define) ; internal
|
[(define) ; internal
|
||||||
(cond [(and (list2? tail) (null? (car tail))) ; idless
|
(let ([tail (preprocess-define head tail)])
|
||||||
(let ([init (cadr tail)])
|
(cond [(list1? tail) ; idless
|
||||||
(loop env (cons #f ids) (cons init inits) (cons #f nids) rest))]
|
(let ([init (car tail)])
|
||||||
[(and (list2? tail) (id? (car tail)))
|
(loop env (cons #f ids) (cons init inits) (cons #f nids) rest))]
|
||||||
(let* ([id (car tail)] [init (cadr tail)]
|
[else ; (id sexp)
|
||||||
[nid (gensym (id->sym id))] [env (add-local-var id nid env)])
|
(let* ([id (car tail)] [init (cadr tail)]
|
||||||
(loop env (cons id ids) (cons init inits) (cons nid nids) rest))]
|
[nid (gensym (id->sym id))] [env (add-local-var id nid env)])
|
||||||
[(and (list2+? tail) (pair? (car tail)) (id? (caar tail)) (idslist? (cdar tail)))
|
(loop env (cons id ids) (cons init inits) (cons nid nids) rest))]))]
|
||||||
(let* ([id (caar tail)] [init (cons lambda-id (cons (cdar tail) (cdr tail)))]
|
|
||||||
[nid (gensym (id->sym id))] [env (add-local-var id nid env)])
|
|
||||||
(loop env (cons id ids) (cons init inits) (cons nid nids) rest))]
|
|
||||||
[else (x-error "improper define form" first)])]
|
|
||||||
[(define-syntax) ; internal
|
[(define-syntax) ; internal
|
||||||
(if (and (list2? tail) (id? (car tail)))
|
(let ([tail (preprocess-define-syntax head tail)])
|
||||||
(let* ([id (car tail)] [init (cadr tail)]
|
(let* ([id (car tail)] [init (cadr tail)]
|
||||||
[env (extend-xenv-local id '(undefined) env)]) ; placeholder val
|
[env (extend-xenv-local id '(undefined) env)]) ; placeholder val
|
||||||
(loop env (cons id ids) (cons init inits) (cons #t nids) rest))
|
(loop env (cons id ids) (cons init inits) (cons #t nids) rest)))]
|
||||||
(x-error "improper define-syntax form" first))]
|
|
||||||
[(define-library) ; internal
|
[(define-library) ; internal
|
||||||
(if (and (list2+? tail) (listname? (car tail)))
|
(if (and (list2+? tail) (listname? (car tail)))
|
||||||
; note: library is fully expanded in incomplete env, to make it
|
; note: library is fully expanded in incomplete env, to make it
|
||||||
|
@ -615,8 +648,7 @@
|
||||||
[(and (list2+? tail) (pair? (car tail)) (id? (caar tail)) (idslist? (cdar tail)))
|
[(and (list2+? tail) (pair? (car tail)) (id? (caar tail)) (idslist? (cdar tail)))
|
||||||
(list 'define (id->sym (caar tail))
|
(list 'define (id->sym (caar tail))
|
||||||
(xform-lambda (cons (cdar tail) (cdr tail)) env))]
|
(xform-lambda (cons (cdar tail) (cdr tail)) env))]
|
||||||
[else
|
[else (x-error "improper define form" (cons 'define tail))]))
|
||||||
(x-error "improper define form" (cons 'define tail))]))
|
|
||||||
|
|
||||||
(define (xform-define-syntax tail env) ; non-internal
|
(define (xform-define-syntax tail env) ; non-internal
|
||||||
(if (and (list2? tail) (id? (car tail)))
|
(if (and (list2? tail) (id? (car tail)))
|
||||||
|
@ -1037,20 +1069,22 @@
|
||||||
(cond
|
(cond
|
||||||
[(eq? hval 'begin)
|
[(eq? hval 'begin)
|
||||||
(unless (list? tail) (x-error "improper begin form" first))
|
(unless (list? tail) (x-error "improper begin form" first))
|
||||||
(scan (append tail rest) code*)]
|
(scan (append tail rest) code*)] ; splice
|
||||||
[(and (eq? hval 'define) (list2? tail) (null? (car tail))) ; special idless define
|
|
||||||
(scan (append (cadr tail) rest) code*)]
|
|
||||||
[(eq? hval 'define)
|
[(eq? hval 'define)
|
||||||
(let* ([core (xform-define tail cenv)]
|
(let ([tail (preprocess-define head tail)])
|
||||||
[loc (xenv-lookup cenv (cadr core) 'define)])
|
(if (list1? tail) ; tail is either (sexp) or (id sexp)
|
||||||
(unless (location? loc) (x-error "unexpected define for id" (cadr core) first))
|
(scan (append tail rest) code*) ; idless, splice
|
||||||
(scan rest (cons (list 'set! (cadr (location-val loc)) (caddr core)) code*)))]
|
(let ([loc (top-defined-id-lookup cenv (car tail) 'define)])
|
||||||
|
(unless (and (location? loc) (sexp-match? '(ref *) (location-val loc)))
|
||||||
|
(x-error "unexpected define for id" (car tail) first))
|
||||||
|
(let ([g (cadr (location-val loc))] [core (xform #f (cadr tail) cenv)])
|
||||||
|
(scan rest (cons (list 'set! g core) code*))))))]
|
||||||
[(eq? hval 'define-syntax)
|
[(eq? hval 'define-syntax)
|
||||||
(let* ([core (xform-define-syntax tail cenv)]
|
(let* ([tail (preprocess-define-syntax head tail)]
|
||||||
[loc (xenv-lookup cenv (cadr core) 'define-syntax)])
|
[loc (top-defined-id-lookup cenv (car tail) 'define-syntax)])
|
||||||
(unless (location? loc)
|
(unless (location? loc)
|
||||||
(x-error "unexpected define-syntax for id" (cadr core) first))
|
(x-error "unexpected define-syntax for id" (car tail) first))
|
||||||
(location-set-val! loc (caddr core))
|
(location-set-val! loc (xform #t (cadr tail) cenv))
|
||||||
(scan rest code*))]
|
(scan rest code*))]
|
||||||
[(eq? hval 'define-library)
|
[(eq? hval 'define-library)
|
||||||
(let* ([core (xform-define-library head tail env #f)]
|
(let* ([core (xform-define-library head tail env #f)]
|
||||||
|
@ -2249,28 +2283,27 @@
|
||||||
(cond
|
(cond
|
||||||
[(eq? hval 'begin) ; splice
|
[(eq? hval 'begin) ; splice
|
||||||
(let loop ([x* (cdr x)])
|
(let loop ([x* (cdr x)])
|
||||||
(cond [(null? x*) (void)] ; nothing valuable leaks
|
(cond [(null? x*) (void)]
|
||||||
[(not (pair? x*)) (x-error "invalid begin form:" x)]
|
[(not (pair? x*)) (x-error "invalid begin form:" x)]
|
||||||
[(null? (cdr x*)) (evaluate-top-form (car x*) env)] ; tail call
|
[(null? (cdr x*)) (evaluate-top-form (car x*) env)] ; tail call
|
||||||
[else (evaluate-top-form (car x*) env) (loop (cdr x*))]))]
|
[else (evaluate-top-form (car x*) env) (loop (cdr x*))]))]
|
||||||
[(and (eq? hval 'define) (null? (cadr x))) ; special idless define
|
|
||||||
(evaluate-top-form (caddr x) env) (void)] ; nothing valuable leaks
|
|
||||||
[(eq? hval 'define) ; use new protocol for top-level envs
|
[(eq? hval 'define) ; use new protocol for top-level envs
|
||||||
(let* ([core (xform-define (cdr x) env)]
|
(let ([tail (preprocess-define (car x) (cdr x))])
|
||||||
[loc (xenv-lookup env (cadr core) 'define)])
|
(if (list1? tail) ; tail is either (sexp) or (id sexp)
|
||||||
(if (and loc (sexp-match? '(ref *) (location-val loc)))
|
(begin (evaluate-top-form (car tail) env) (void))
|
||||||
(compile-and-run-core-expr ; tail
|
(let ([loc (top-defined-id-lookup env (car tail) 'define)])
|
||||||
(list 'set! (cadr (location-val loc)) (caddr core)))
|
(unless (and (location? loc) (sexp-match? '(ref *) (location-val loc)))
|
||||||
(x-error "identifier cannot be (re)defined as variable in env:"
|
(x-error "identifier cannot be (re)defined as variable" (car tail) x))
|
||||||
(cadr core) env)))]
|
(let ([g (cadr (location-val loc))] [core (xform #f (cadr tail) env)])
|
||||||
|
(compile-and-run-core-expr (list 'set! g core)) (void)))))]
|
||||||
[(eq? hval 'define-syntax) ; use new protocol for top-level envs
|
[(eq? hval 'define-syntax) ; use new protocol for top-level envs
|
||||||
(let* ([core (xform-define-syntax (cdr x) env)]
|
(let* ([tail (preprocess-define-syntax (car x) (cdr x))]
|
||||||
; core is (define-syntax <name> <library>)
|
[loc (top-defined-id-lookup env (car tail) 'define-syntax)])
|
||||||
[loc (xenv-lookup env (cadr core) 'define-syntax)])
|
|
||||||
(unless (location? loc)
|
(unless (location? loc)
|
||||||
(x-error "unexpected define-syntax for id" (cadr core) x))
|
(x-error "unexpected define-syntax for id" (car tail) x))
|
||||||
(location-set-val! loc (caddr core))
|
(location-set-val! loc (xform #t (cadr tail) env))
|
||||||
(when *verbose* (display "SYNTAX INSTALLED: ") (write (cadr core)) (newline)))]
|
(when *verbose* (display "SYNTAX INSTALLED: ") (write (car tail)) (newline))
|
||||||
|
(void))]
|
||||||
[(eq? hval 'define-library) ; use new protocol for top-level envs
|
[(eq? hval 'define-library) ; use new protocol for top-level envs
|
||||||
(let* ([core (xform-define-library (car x) (cdr x) env #t)]
|
(let* ([core (xform-define-library (car x) (cdr x) env #t)]
|
||||||
; core is (define-library <listname> <library>)
|
; core is (define-library <listname> <library>)
|
||||||
|
|
166
t.c
166
t.c
|
@ -186,9 +186,18 @@ char *t_code[] = {
|
||||||
"id-lookup)[02}}{f},${.6,@(y7:id->sym)[01},.6,.6,'(s16:env peek failed!"
|
"id-lookup)[02}}{f},${.6,@(y7:id->sym)[01},.6,.6,'(s16:env peek failed!"
|
||||||
"),@(y7:x-error)[05}}.3,.1^,${.5,@(y7:id->sym)[01},@(y6:new-id)[43",
|
"),@(y7:x-error)[05}}.3,.1^,${.5,@(y7:id->sym)[01},@(y6:new-id)[43",
|
||||||
|
|
||||||
|
"P", "gensym-ref-value-helper",
|
||||||
|
"%2.0,&1{%1:0?{${.2,@(y6:gensym)[01}}{.0},'(y3:ref),l2]1},.2a,.3da,@(y1"
|
||||||
|
"1:name-lookup)[23",
|
||||||
|
|
||||||
"P", "new-id-lookup",
|
"P", "new-id-lookup",
|
||||||
"%2${.2[00},.0da,'(y4:peek),.4q,.0?{.0}{.1Y2}_1?{.0]4}&0{%1.0,'(y3:ref)"
|
"%2${.2[00},.0da,'(y4:peek),.4q,.0?{.0}{.1Y2}_1?{.0]4}.1,f,@(y23:gensym"
|
||||||
",l2]1},.2a,.2,@(y11:name-lookup)[43",
|
"-ref-value-helper)[42",
|
||||||
|
|
||||||
|
"P", "top-defined-id-lookup",
|
||||||
|
"%3'(l2:y6:define;y13:define-syntax;),.3A0?{.1Y0?{.2,.2,.2,@(y11:xenv-l"
|
||||||
|
"ookup)[33}${.3[00},.0da,.0Y2?{.0]5}.1,t,@(y23:gensym-ref-value-helper)"
|
||||||
|
"[52}f]3",
|
||||||
|
|
||||||
"P", "extend-xenv-local",
|
"P", "extend-xenv-local",
|
||||||
"%3.1b,.1p?{.3,.1,.3,&3{%2.0,:0e?{.1,'(l3:y3:ref;y4:set!;y4:peek;),.1A1"
|
"%3.1b,.1p?{.3,.1,.3,&3{%2.0,:0e?{.1,'(l3:y3:ref;y4:set!;y4:peek;),.1A1"
|
||||||
|
@ -339,37 +348,42 @@ char *t_code[] = {
|
||||||
"@(y5:xform)[03},'(y6:withcc),l4]2}.0,'(y6:withcc)c,'(s20:improper with"
|
"@(y5:xform)[03},'(y6:withcc),l4]2}.0,'(y6:withcc)c,'(s20:improper with"
|
||||||
"cc form),@(y7:x-error)[22",
|
"cc form),@(y7:x-error)[22",
|
||||||
|
|
||||||
|
"P", "preprocess-define",
|
||||||
|
"%2${.3,@(y6:list2?)[01}?{.1au}{f}?{.1d]2}${.3,@(y6:list2?)[01}?{${.3a,"
|
||||||
|
"@(y3:id?)[01}}{f}?{.1]2}${.3,@(y7:list2+?)[01}?{.1ap?{${.3aa,@(y3:id?)"
|
||||||
|
"[01}?{${.3ad,@(y8:idslist?)[01}}{f}}{f}}{f}?{.1d,.2adc,@(y9:lambda-id)"
|
||||||
|
"c,.2aa,l2]2}.1,.1c,'(s20:improper define form),@(y7:x-error)[22",
|
||||||
|
|
||||||
|
"P", "preprocess-define-syntax",
|
||||||
|
"%2${.3,@(y6:list2?)[01}?{${.3a,@(y3:id?)[01}}{f}?{.1]2}.1,.1c,'(s27:im"
|
||||||
|
"proper define-syntax form),@(y7:x-error)[22",
|
||||||
|
|
||||||
"P", "xform-body",
|
"P", "xform-body",
|
||||||
"%3.0u?{'(y5:begin),l1]3}${.2,@(y6:list1?)[01}?{.1,.1a,.4,@(y5:xform)[3"
|
"%3.0u?{'(y5:begin),l1]3}${.2,@(y6:list1?)[01}?{.1,.1a,.4,@(y5:xform)[3"
|
||||||
"3}.0L0~?{.0,'(y4:body)c,'(s18:improper body form),@(y7:x-error)[32}.0,"
|
"3}.0L0~?{.0,'(y4:body)c,'(s18:improper body form),@(y7:x-error)[32}.0,"
|
||||||
"n,n,n,.5,,#0.8,.1,&2{%5.4p?{.4ap}{f}?{.4d,.5a,.0a,.1d,${.6,.4,t,@(y5:x"
|
"n,n,n,.5,,#0.8,.1,&2{%5.4p?{.4ap}{f}?{.4d,.5a,.0a,.1d,${.6,.4,t,@(y5:x"
|
||||||
"form)[03},.0,'(y5:begin),.1v?{.2L0?{.5,.3L6,.(i10),.(i10),.(i10),.(i10"
|
"form)[03},.0,'(y5:begin),.1v?{.2L0?{.5,.3L6,.(i10),.(i10),.(i10),.(i10"
|
||||||
"),:0^[(i11)5}.4,'(s19:improper begin form),@(y7:x-error)[(i11)2}'(y6:d"
|
"),:0^[(i11)5}.4,'(s19:improper begin form),@(y7:x-error)[(i11)2}'(y6:d"
|
||||||
"efine),.1v?{${.4,@(y6:list2?)[01}?{.2au}{f}?{.2da,.6,.(i11),fc,.(i11),"
|
"efine),.1v?{${.4,.6,@(y17:preprocess-define)[02},${.2,@(y6:list1?)[01}"
|
||||||
".3c,.(i11),fc,.(i11),:0^[(i12)5}${.4,@(y6:list2?)[01}?{${.4a,@(y3:id?)"
|
"?{.0a,.7,.(i12),fc,.(i12),.3c,.(i12),fc,.(i12),:0^[(i13)5}.0a,.1da,${$"
|
||||||
"[01}}{f}?{.2a,.3da,${${.5,@(y7:id->sym)[01},@(y6:gensym)[01},${.(i11),"
|
"{.5,@(y7:id->sym)[01},@(y6:gensym)[01},${.(i12),.3,.6,@(y13:add-local-"
|
||||||
".3,.6,@(y13:add-local-var)[03},.9,.(i14),.3c,.(i14),.5c,.(i14),.7c,.4,"
|
"var)[03},.(i10),.(i15),.3c,.(i15),.5c,.(i15),.7c,.4,:0^[(i16)5}'(y13:d"
|
||||||
":0^[(i15)5}${.4,@(y7:list2+?)[01}?{.2ap?{${.4aa,@(y3:id?)[01}?{${.4ad,"
|
"efine-syntax),.1v?{${.4,.6,@(y24:preprocess-define-syntax)[02},.0a,.1d"
|
||||||
"@(y8:idslist?)[01}}{f}}{f}}{f}?{.2aa,.3d,.4adc,@(y9:lambda-id)c,${${.5"
|
"a,${.(i11),'(l1:y9:undefined;),.5,@(y17:extend-xenv-local)[03},.9,.(i1"
|
||||||
",@(y7:id->sym)[01},@(y6:gensym)[01},${.(i11),.3,.6,@(y13:add-local-var"
|
"4),tc,.(i14),.4c,.(i14),.6c,.4,:0^[(i15)5}'(y14:define-library),.1v?{$"
|
||||||
")[03},.9,.(i14),.3c,.(i14),.5c,.(i14),.7c,.4,:0^[(i15)5}.4,'(s20:impro"
|
"{.4,@(y7:list2+?)[01}?{${.4a,@(y9:listname?)[01}}{f}?{${f,.9,.6,.8,@(y"
|
||||||
"per define form),@(y7:x-error)[(i11)2}'(y13:define-syntax),.1v?{${.4,@"
|
"20:xform-define-library)[04},.0da,.1dda,${.(i11),.3,.5,@(y17:extend-xe"
|
||||||
"(y6:list2?)[01}?{${.4a,@(y3:id?)[01}}{f}?{.2a,.3da,${.(i10),'(l1:y9:un"
|
"nv-local)[03},.9,.(i14),.(i14),.(i14),.4,:0^[(i15)5}.4,'(s28:improper "
|
||||||
"defined;),.5,@(y17:extend-xenv-local)[03},.8,.(i13),tc,.(i13),.4c,.(i1"
|
"define-library form),@(y7:x-error)[(i11)2}'(y6:import),.1v?{.2L0?{${f,"
|
||||||
"3),.6c,.4,:0^[(i14)5}.4,'(s27:improper define-syntax form),@(y7:x-erro"
|
".9,.6,.8,@(y12:xform-import)[04},.0da,'0,.1V4,'1,.2V4,.(i10),.1,,#0.(i"
|
||||||
"r)[(i11)2}'(y14:define-library),.1v?{${.4,@(y7:list2+?)[01}?{${.4a,@(y"
|
"10),.1,.(i14),.(i19),.(i19),.(i19),:0,.(i11),&8{%2.0u?{:0,@(y15:syntax"
|
||||||
"9:listname?)[01}}{f}?{${f,.9,.6,.8,@(y20:xform-define-library)[04},.0d"
|
"-quote-id),l2,:5,:4,fc,:3,.3c,:2,fc,.6,:1^[35}.0ad,${.3aa,:7,@(y12:id-"
|
||||||
"a,.1dda,${.(i11),.3,.5,@(y17:extend-xenv-local)[03},.9,.(i14),.(i14),."
|
"rename-as)[02},.3,.2,.2,&3{%2:0,.1q?{'(l2:y3:ref;y4:peek;),.2A0?{:1]2}"
|
||||||
"(i14),.4,:0^[(i15)5}.4,'(s28:improper define-library form),@(y7:x-erro"
|
"f]2}.1,.1,:2[22},.3d,:6^[42}.!0.0^_1[(i15)2}.4,'(s20:improper import f"
|
||||||
"r)[(i11)2}'(y6:import),.1v?{.2L0?{${f,.9,.6,.8,@(y12:xform-import)[04}"
|
"orm),@(y7:x-error)[(i11)2}.1K0?{.5,${.9,.8,.6[02}c,.(i10),.(i10),.(i10"
|
||||||
",.0da,'0,.1V4,'1,.2V4,.(i10),.1,,#0.(i10),.1,.(i14),.(i19),.(i19),.(i1"
|
"),.(i10),:0^[(i11)5}:1,.7,.(i12),.(i12)A8,.(i12)A8,.(i12)A8,@(y12:xfor"
|
||||||
"9),:0,.(i11),&8{%2.0u?{:0,@(y15:syntax-quote-id),l2,:5,:4,fc,:3,.3c,:2"
|
"m-labels)[(i11)6}:1,.1,.6,.6A8,.6A8,.6A8,@(y12:xform-labels)[56}.!0.0^"
|
||||||
",fc,.6,:1^[35}.0ad,${.3aa,:7,@(y12:id-rename-as)[02},.3,.2,.2,&3{%2:0,"
|
"_1[35",
|
||||||
".1q?{'(l2:y3:ref;y4:peek;),.2A0?{:1]2}f]2}.1,.1,:2[22},.3d,:6^[42}.!0."
|
|
||||||
"0^_1[(i15)2}.4,'(s20:improper import form),@(y7:x-error)[(i11)2}.1K0?{"
|
|
||||||
".5,${.9,.8,.6[02}c,.(i10),.(i10),.(i10),.(i10),:0^[(i11)5}:1,.7,.(i12)"
|
|
||||||
",.(i12)A8,.(i12)A8,.(i12)A8,@(y12:xform-labels)[(i11)6}:1,.1,.6,.6A8,."
|
|
||||||
"6A8,.6A8,@(y12:xform-labels)[56}.!0.0^_1[35",
|
|
||||||
|
|
||||||
"P", "xform-labels",
|
"P", "xform-labels",
|
||||||
"%6,#0${.5,&0{%1t,.1q]1},@(y6:andmap)[02}.!0n,n,.5,.5,.5,,#0.0,.(i12),."
|
"%6,#0${.5,&0{%1t,.1q]1},@(y6:andmap)[02}.!0n,n,.5,.5,.5,,#0.0,.(i12),."
|
||||||
|
@ -610,28 +624,29 @@ char *t_code[] = {
|
||||||
"rolled-environment)[03},n,,#0.(i12),.1,.4,&3{%2.0u?{.1]2}.0d,.1a,.0p?{"
|
"rolled-environment)[03},n,,#0.(i12),.1,.4,&3{%2.0u?{.1]2}.0d,.1a,.0p?{"
|
||||||
".0a,.1d,${:0,.4,t,@(y5:xform)[03},'(y5:begin),.1q?{.1L0~?{${.5,'(s19:i"
|
".0a,.1d,${:0,.4,t,@(y5:xform)[03},'(y5:begin),.1q?{.1L0~?{${.5,'(s19:i"
|
||||||
"mproper begin form),@(y7:x-error)[02}}.6,.5,.3L6,:1^[72}'(y6:define),."
|
"mproper begin form),@(y7:x-error)[02}}.6,.5,.3L6,:1^[72}'(y6:define),."
|
||||||
"1q?{${.3,@(y6:list2?)[01}?{.1au}{f}}{f}?{.6,.5,.3daL6,:1^[72}'(y6:defi"
|
"1q?{${.3,.5,@(y17:preprocess-define)[02},${.2,@(y6:list1?)[01}?{.7,.6,"
|
||||||
"ne),.1q?{${:0,.4,@(y12:xform-define)[02},${'(y6:define),.3da,:0,@(y11:"
|
".2L6,:1^[82}${'(y6:define),.3a,:0,@(y21:top-defined-id-lookup)[03},.0Y"
|
||||||
"xenv-lookup)[03},.0Y2~?{${.7,.4da,'(s24:unexpected define for id),@(y7"
|
"2?{${.2z,'(l2:y3:ref;y1:*;),@(y11:sexp-match?)[02}}{f}~?{${.7,.4a,'(s2"
|
||||||
":x-error)[03}}.8,.2dda,.2zda,'(y4:set!),l3c,.7,:1^[92}'(y13:define-syn"
|
"4:unexpected define for id),@(y7:x-error)[03}}${:0,.4da,f,@(y5:xform)["
|
||||||
"tax),.1q?{${:0,.4,@(y19:xform-define-syntax)[02},${'(y13:define-syntax"
|
"03},.1zda,.(i10),.2,.2,'(y4:set!),l3c,.9,:1^[(i11)2}'(y13:define-synta"
|
||||||
"),.3da,:0,@(y11:xenv-lookup)[03},.0Y2~?{${.7,.4da,'(s31:unexpected def"
|
"x),.1q?{${.3,.5,@(y24:preprocess-define-syntax)[02},${'(y13:define-syn"
|
||||||
"ine-syntax for id),@(y7:x-error)[03}}.1dda,.1sz.8,.7,:1^[92}'(y14:defi"
|
"tax),.3a,:0,@(y21:top-defined-id-lookup)[03},.0Y2~?{${.7,.4a,'(s31:une"
|
||||||
"ne-library),.1q?{${f,:2,.5,.7,@(y20:xform-define-library)[04},${'(y13:"
|
"xpected define-syntax for id),@(y7:x-error)[03}}${:0,.4da,t,@(y5:xform"
|
||||||
"define-syntax),.3da,:2,@(y11:xenv-lookup)[03},.0Y2~?{${.7,.4da,'(s32:u"
|
")[03},.1sz.8,.7,:1^[92}'(y14:define-library),.1q?{${f,:2,.5,.7,@(y20:x"
|
||||||
"nexpected define-library for id),@(y7:x-error)[03}}.1dda,.1sz.8,.7,:1^"
|
"form-define-library)[04},${'(y13:define-syntax),.3da,:2,@(y11:xenv-loo"
|
||||||
"[92}'(y6:import),.1q?{${f,:0,.5,.7,@(y12:xform-import)[04},.0da,'0,.1V"
|
"kup)[03},.0Y2~?{${.7,.4da,'(s32:unexpected define-library for id),@(y7"
|
||||||
"4,'1,.2V4,${'(y6:import),.3,:0[02}~?{${.9,'(s33:broken import inside l"
|
":x-error)[03}}.1dda,.1sz.8,.7,:1^[92}'(y6:import),.1q?{${f,:0,.5,.7,@("
|
||||||
"ibrary code),@(y7:x-error)[02}}.(i10),.2c,.9,:1^[(i11)2}.0K0?{.6,.5,${"
|
"y12:xform-import)[04},.0da,'0,.1V4,'1,.2V4,${'(y6:import),.3,:0[02}~?{"
|
||||||
":0,.8,.6[02}c,:1^[72}.0U0?{.6,${:0,.5,.5,@(y16:xform-integrable)[03}c,"
|
"${.9,'(s33:broken import inside library code),@(y7:x-error)[02}}.(i10)"
|
||||||
".5,:1^[72}.6,${:0,.7,f,@(y5:xform)[03}c,.5,:1^[72}.3,${:0,.4,f,@(y5:xf"
|
",.2c,.9,:1^[(i11)2}.0K0?{.6,.5,${:0,.8,.6[02}c,:1^[72}.0U0?{.6,${:0,.5"
|
||||||
"orm)[03}c,.2,:1^[42}.!0${n,.6,.4^[02},.0A9,'(y5:begin)c,${.(i13)?{.2,."
|
",.5,@(y16:xform-integrable)[03}c,.5,:1^[72}.6,${:0,.7,f,@(y5:xform)[03"
|
||||||
"(i14),'(y4:once),l3}{.2},.(i11),@(y11:adjoin-code)[02},.4,.8,,#0.8,.1,"
|
"}c,.5,:1^[72}.3,${:0,.4,f,@(y5:xform)[03}c,.2,:1^[42}.!0${n,.6,.4^[02}"
|
||||||
".5,&3{%2.0u?{.1A9,:0c]2}.0aa,.1ad,${'(y3:ref),.4,:2[02},.0~?{.2,'(s16:"
|
",.0A9,'(y5:begin)c,${.(i13)?{.2,.(i14),'(y4:once),l3}{.2},.(i11),@(y11"
|
||||||
"cannot export id),@(y7:x-error)[52}${.2,@(y17:location-special?)[01}?{"
|
":adjoin-code)[02},.4,.8,,#0.8,.1,.5,&3{%2.0u?{.1A9,:0c]2}.0aa,.1ad,${'"
|
||||||
".4,.1,.3cc,.4d,:1^[52}.0z,.0p~,.0?{.0}{'(l2:y3:ref;y5:const;),.2aA0}_1"
|
"(y3:ref),.4,:2[02},.0~?{.2,'(s16:cannot export id),@(y7:x-error)[52}${"
|
||||||
"?{.5,.2,.4cc,.5d,:1^[62}.0,.4,'(s27:cannot export code alias id),@(y7:"
|
".2,@(y17:location-special?)[01}?{.4,.1,.3cc,.4d,:1^[52}.0z,.0p~,.0?{.0"
|
||||||
"x-error)[63}.!0.0^_1[(i16)2",
|
"}{'(l2:y3:ref;y5:const;),.2aA0}_1?{.5,.2,.4cc,.5d,:1^[62}.0,.4,'(s27:c"
|
||||||
|
"annot export code alias id),@(y7:x-error)[63}.!0.0^_1[(i16)2",
|
||||||
|
|
||||||
"P", "xform-define-library",
|
"P", "xform-define-library",
|
||||||
"%4${.3,@(y7:list2+?)[01}?{${.3a,@(y9:listname?)[01}}{f}?{${.3a,@(y17:x"
|
"%4${.3,@(y7:list2+?)[01}?{${.3a,@(y9:listname?)[01}}{f}?{${.3a,@(y17:x"
|
||||||
|
@ -1429,32 +1444,33 @@ char *t_code[] = {
|
||||||
"%2.0p?{${.3,.3a,t,@(y5:xform)[03},'(y5:begin),.1q?{.1d,,#0.0,.5,.5,&3{"
|
"%2.0p?{${.3,.3a,t,@(y5:xform)[03},'(y5:begin),.1q?{.1d,,#0.0,.5,.5,&3{"
|
||||||
"%1.0u?{Y9]1}.0p~?{:0,'(s19:invalid begin form:),@(y7:x-error)[12}.0du?"
|
"%1.0u?{Y9]1}.0p~?{:0,'(s19:invalid begin form:),@(y7:x-error)[12}.0du?"
|
||||||
"{:1,.1a,@(y17:evaluate-top-form)[12}${:1,.3a,@(y17:evaluate-top-form)["
|
"{:1,.1a,@(y17:evaluate-top-form)[12}${:1,.3a,@(y17:evaluate-top-form)["
|
||||||
"02}.0d,:2^[11}.!0.0^_1[31}'(y6:define),.1q?{.1dau}{f}?{${.4,.4dda,@(y1"
|
"02}.0d,:2^[11}.!0.0^_1[31}'(y6:define),.1q?{${.3d,.4a,@(y17:preprocess"
|
||||||
"7:evaluate-top-form)[02}Y9]3}'(y6:define),.1q?{${.4,.4d,@(y12:xform-de"
|
"-define)[02},${.2,@(y6:list1?)[01}?{${.5,.3a,@(y17:evaluate-top-form)["
|
||||||
"fine)[02},${'(y6:define),.3da,.7,@(y11:xenv-lookup)[03},.0?{${.2z,'(l2"
|
"02}Y9]4}${'(y6:define),.3a,.7,@(y21:top-defined-id-lookup)[03},.0Y2?{$"
|
||||||
":y3:ref;y1:*;),@(y11:sexp-match?)[02}}{f}?{.1dda,.1zda,'(y4:set!),l3,@"
|
"{.2z,'(l2:y3:ref;y1:*;),@(y11:sexp-match?)[02}}{f}~?{${.5,.4a,'(s44:id"
|
||||||
"(y25:compile-and-run-core-expr)[51}.4,.2da,'(s52:identifier cannot be "
|
"entifier cannot be (re)defined as variable),@(y7:x-error)[03}}${.6,.4d"
|
||||||
"(re)defined as variable in env:),@(y7:x-error)[53}'(y13:define-syntax)"
|
"a,f,@(y5:xform)[03},.1zda,${.3,.3,'(y4:set!),l3,@(y25:compile-and-run-"
|
||||||
",.1q?{${.4,.4d,@(y19:xform-define-syntax)[02},${'(y13:define-syntax),."
|
"core-expr)[01}Y9]7}'(y13:define-syntax),.1q?{${.3d,.4a,@(y24:preproces"
|
||||||
"3da,.7,@(y11:xenv-lookup)[03},.0Y2~?{${.5,.4da,'(s31:unexpected define"
|
"s-define-syntax)[02},${'(y13:define-syntax),.3a,.7,@(y21:top-defined-i"
|
||||||
"-syntax for id),@(y7:x-error)[03}}.1dda,.1sz@(y9:*verbose*)?{Po,'(s18:"
|
"d-lookup)[03},.0Y2~?{${.5,.4a,'(s31:unexpected define-syntax for id),@"
|
||||||
"SYNTAX INSTALLED: )W4Po,.2daW5PoW6]5}]5}'(y14:define-library),.1q?{${t"
|
"(y7:x-error)[03}}${.6,.4da,t,@(y5:xform)[03},.1sz@(y9:*verbose*)?{Po,'"
|
||||||
",.5,.5d,.6a,@(y20:xform-define-library)[04},${'(y13:define-syntax),.3d"
|
"(s18:SYNTAX INSTALLED: )W4Po,.2aW5PoW6}Y9]5}'(y14:define-library),.1q?"
|
||||||
"a,.7,@(y11:xenv-lookup)[03},.0Y2~?{${.5,.4da,'(s32:unexpected define-l"
|
"{${t,.5,.5d,.6a,@(y20:xform-define-library)[04},${'(y13:define-syntax)"
|
||||||
"ibrary for id),@(y7:x-error)[03}}.1dda,.1sz@(y9:*verbose*)?{Po,'(s19:L"
|
",.3da,.7,@(y11:xenv-lookup)[03},.0Y2~?{${.5,.4da,'(s32:unexpected defi"
|
||||||
"IBRARY INSTALLED: )W4Po,.2daW5PoW6]5}]5}'(y6:import),.1q?{${t,.5,.5d,."
|
"ne-library for id),@(y7:x-error)[03}}.1dda,.1sz@(y9:*verbose*)?{Po,'(s"
|
||||||
"6a,@(y12:xform-import)[04},.0da,'0,.1V4,'1,.2V4,${'(y6:import),.3,.(i1"
|
"19:LIBRARY INSTALLED: )W4Po,.2daW5PoW6]5}]5}'(y6:import),.1q?{${t,.5,."
|
||||||
"0)[02},.0~?{${.3,.(i10),'(s49:failed to import to env, import is not s"
|
"5d,.6a,@(y12:xform-import)[04},.0da,'0,.1V4,'1,.2V4,${'(y6:import),.3,"
|
||||||
"upported:),@(y7:x-error)[03}}@(y7:*quiet*)~,.0?{.0}{@(y9:*verbose*)}_1"
|
".(i10)[02},.0~?{${.3,.(i10),'(s49:failed to import to env, import is n"
|
||||||
"?{${.2,'(l3:y8:<number>;y8:<number>;y8:<number>;),@(y11:sexp-match?)[0"
|
"ot supported:),@(y7:x-error)[03}}@(y7:*quiet*)~,.0?{.0}{@(y9:*verbose*"
|
||||||
"2}}{f}?{@(y9:*verbose*)?{Po,'(s8:IMPORT: )W4}{Po,'(s10:; import: )W4}P"
|
")}_1?{${.2,'(l3:y8:<number>;y8:<number>;y8:<number>;),@(y11:sexp-match"
|
||||||
"o,.1aW5Po,'(s24: bindings are the same, )W4Po,.1daW5Po,'(s11: modified"
|
"?)[02}}{f}?{@(y9:*verbose*)?{Po,'(s8:IMPORT: )W4}{Po,'(s10:; import: )"
|
||||||
", )W4Po,.1ddaW5Po,'(s7: added%0a)W4}_1.1,@(y25:compile-and-run-core-ex"
|
"W4}Po,.1aW5Po,'(s24: bindings are the same, )W4Po,.1daW5Po,'(s11: modi"
|
||||||
"pr)[71}.0K0?{.2,${.5,.5,.5[02},@(y17:evaluate-top-form)[32}.0U0?{${.4,"
|
"fied, )W4Po,.1ddaW5Po,'(s7: added%0a)W4}_1.1,@(y25:compile-and-run-cor"
|
||||||
".4d,.4,@(y16:xform-integrable)[03},@(y25:compile-and-run-core-expr)[31"
|
"e-expr)[71}.0K0?{.2,${.5,.5,.5[02},@(y17:evaluate-top-form)[32}.0U0?{$"
|
||||||
"}.0Y0?{${.4,.4,f,@(y5:xform)[03},@(y25:compile-and-run-core-expr)[31}$"
|
"{.4,.4d,.4,@(y16:xform-integrable)[03},@(y25:compile-and-run-core-expr"
|
||||||
"{.4,.4d,.4,@(y10:xform-call)[03},@(y25:compile-and-run-core-expr)[31}$"
|
")[31}.0Y0?{${.4,.4,f,@(y5:xform)[03},@(y25:compile-and-run-core-expr)["
|
||||||
"{.3,.3,f,@(y5:xform)[03},@(y25:compile-and-run-core-expr)[21",
|
"31}${.4,.4d,.4,@(y10:xform-call)[03},@(y25:compile-and-run-core-expr)["
|
||||||
|
"31}${.3,.3,f,@(y5:xform)[03},@(y25:compile-and-run-core-expr)[21",
|
||||||
|
|
||||||
"P", "eval",
|
"P", "eval",
|
||||||
"%!1,#0.1p?{.1a}{${@(y23:interaction-environment)[00}}.!0.0^,.3,@(y17:e"
|
"%!1,#0.1p?{.1a}{${@(y23:interaction-environment)[00}}.!0.0^,.3,@(y17:e"
|
||||||
|
|
Loading…
Reference in a new issue