ref: 58ce0e39771b46ec93bc8295b93bc63ec0904729
parent: a69ae5ed2a33e8d1a62391e57347285228ba4054
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Fri Nov 29 22:16:24 EST 2024
builtin->instruction: add missing 'for'
--- a/compiler.lsp
+++ b/compiler.lsp
@@ -372,7 +372,7 @@
list 'list bound? 'bound?
< '< * '* cdr 'cdr cadr 'cadr null? 'null?
+ '+ eqv? 'eqv? compare 'compare aref 'aref
- set-car! 'set-car! car 'car
+ set-car! 'set-car! car 'car for 'for
pair? 'pair? = '= vector? 'vector?)))
(λ (b)
(get b2i b #f))))
@@ -402,7 +402,7 @@
(apply (if (< nargs 2)
(argc-error b 2)
(emit g (if tail? 'tapply 'apply) nargs)))
- (else (emit g b)))))
+ (else (emit g b)))))
(define (inlineable? form)
(let ((lam (car form)))
--- a/flisp.boot
+++ b/flisp.boot
@@ -14,8 +14,8 @@
#fn("8000z0700}2:" #(*)) #fn("8000z0700}2:" #(/))
#fn("8000z0700}2:" #(div0))
#fn("6000n201l:" #()) #fn("6000n201m:" #()) 0 #fn("8000z0700}2:" #(vector))
- #fn("7000n30182p:" #()) 0 0 0 0 0 0 0 0 0 0 0 #fn("9000n320012182>163:" #(#.for
- #fn("6000n1A061:" #()))) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)
+ #fn("7000n30182p:" #()) 0 0 0 0 0 0 0 0 0 0 0 #fn("9000n3012082>1|:" #(#fn("6000n1A061:" #())))
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)
*empty-string* "" *runestring-type* (array rune) *string-type* (array
byte)
*syntax-environment* #table(when #fn(";000z1200211POe4:" #(if begin)) with-output-to #fn("<000z12021e1220e2e1e12315163:" #(#fn(nconc)
@@ -94,7 +94,7 @@
length= cons 'unquote any splice-form? lastcdr #fn(map)
#fn("7000n1700A62:" #(bq-bracket1)) #fn(nconc) list* #fn("=000n20J;02071151P:0B3n00<22CW020731AEl3700=@C07425e2760=AK~52e252P:F<0=770<A521P62:2071760A521P51P:" #(nconc
reverse! unquote nreconc list 'unquote bq-process bq-bracket))) bq-process)
- builtin->instruction #fn("8000n120A0O63:" #(#fn(get)) #(#table(#.cadr cadr #.aset! aset! #.+ + #.- - #.equal? equal? #.eq? eq? #.builtin? builtin? #.not not #.pair? pair? #.aref aref #.cdr cdr #./ / #.div0 div0 #.set-car! set-car! #.vector vector #.set-cdr! set-cdr! #.< < #.cons cons #.apply apply #.eqv? eqv? #.vector? vector? #.list list #.car car #.bound? bound? #.function? function? #.null? null? #.symbol? symbol? #.compare compare #.boolean? boolean? #.fixnum? fixnum? #.atom? atom? #.= = #.number? number? #.* *)))
+ builtin->instruction #fn("8000n120A0O63:" #(#fn(get)) #(#table(#.cadr cadr #.aset! aset! #.+ + #.- - #.equal? equal? #.eq? eq? #.builtin? builtin? #.not not #.pair? pair? #.aref aref #.cdr cdr #./ / #.div0 div0 #.set-car! set-car! #.vector vector #.set-cdr! set-cdr! #.< < #.for for #.cons cons #.apply apply #.eqv? eqv? #.vector? vector? #.list list #.car car #.bound? bound? #.function? function? #.null? null? #.symbol? symbol? #.compare compare #.boolean? boolean? #.fixnum? fixnum? #.atom? atom? #.= = #.number? number? #.* *)))
caaaar #fn("5000n10<<<<:" #() caaaar) caaadr
#fn("5000n10T<<:" #() caaadr) caaar #fn("5000n10<<<:" #() caaar)
caadar #fn("5000n10<T<:" #() caadar) caaddr
@@ -188,7 +188,7 @@
#fn(has?) #fn(put!))) member delete-duplicates) delete-duplicates)
diff #fn("8000n20J40q:200<1523:0710=162:0<710=152P:" #(#fn(memq)
diff) diff)
- disassemble #fn("T000\x871000.///\x881000I60O?14z282JD07001E53471504D:@30D482<2205123051DD2487>1?:425187>2?;4r4268851\x8a<D8<<8=L3\x88242728888<>2O79537:8<<r4523907150@30D42;E87K~2<5348<8<<KM_48>2=8?2>523[08;8>8<<r45348:897?888<<52G5148<8<<r4M_@\x1112=8?2@523V08;8>8<<K5348:89888<<GG5148<8<<KM_@\xe212=8?2A523W08;8>8<<K5347B2C888<<G515148<8<<KM_@\xb212=8?2D523\\08;8>8<<r45347B2C7?888<<52515148<8<<r4M_@}12=8?2E523\xb808;8>8<<r88>2FC70r4@30EM5347B2C7?888<<52512G5248<8<<r4M_47B2C7?888<<52515148<8<<r4M_48>2FCY07B2G5147B2C7?888<<52512G5248<8<<r4M_@30D@\xec08?2Hc3^08;8>8<<r45347B2C7?888<<52512G5248<8<<r4M_@\xb802=8?2I523e08;8>8<<r25347B2J7K8<<r,7L888<<52g3515248<8<<r2M_@z02=8?2M523e08;8>8<<r45347B2J7K8<<r,7?888<<52g3515248<8<<r4M_@<08;8>8<<E53^1^1@\xd3-:" #(disassemble
+ disassemble #fn("T000\x871000.///\x881000I60O?14z282JD07001E53471504D:@30D482<2205123051DD2487>1?:425187>2?;4r4268851\x8a<D8<<8=L3\x85242728888<>2O79537:8<<r4523907150@30D4E87K~2;|48<8<<KM_48>2<8?2=523[08;8>8<<r45348:897>888<<52G5148<8<<r4M_@\x1112<8?2?523V08;8>8<<K5348:89888<<GG5148<8<<KM_@\xe212<8?2@523W08;8>8<<K5347A2B888<<G515148<8<<KM_@\xb212<8?2C523\\08;8>8<<r45347A2B7>888<<52515148<8<<r4M_@}12<8?2D523\xb808;8>8<<r88>2EC70r4@30EM5347A2B7>888<<52512F5248<8<<r4M_47A2B7>888<<52515148<8<<r4M_48>2ECY07A2F5147A2B7>888<<52512F5248<8<<r4M_@30D@\xec08?2Gc3^08;8>8<<r45347A2B7>888<<52512F5248<8<<r4M_@\xb802<8?2H523e08;8>8<<r25347A2I7J8<<r,7K888<<52g3515248<8<<r2M_@z02<8?2L523e08;8>8<<r45347A2I7J8<<r,7>888<<52g3515248<8<<r4M_@<08;8>8<<E53^1^1@\xd6-:" #(disassemble
newline #fn(function:code) #fn(function:vals)
#fn("9000n10\\;36040[S3C07021514720OAKM63:73061:" #(princ "\n" disassemble
print) print-val)
@@ -195,7 +195,7 @@
#fn(";000n370A;3P04FEl;3H0471A7215152;3904A182ML37023@4024751r5~512602765:" #(princ
>= 1- " >" " " hex5 ": " " ") print-inst)
#fn(length) #fn(table-foldl) #fn("7000n382;I?041AF<GQ;34040:" #())
- Instructions > #.for #fn("6000n1702161:" #(princ "\t"))
+ Instructions > #fn("6000n1702161:" #(princ "\t"))
#fn(memq) (loadv.l loadg.l setg.l) ref-int32-LE (loadv loadg setg)
(loada seta loadc call tcall list + - * / vector argc vargc loadi8 apply
tapply closure box shift) princ #fn(number->string)
@@ -318,8 +318,7 @@
#fn(write) nconc #fn(map) list top-level-value #fn(io-write) *linefeed* #fn(io-close)))
#fn("6000n1A50420061:" #(#fn(raise)))) make-system-image)
map! #fn("8000n21D1B3B04101<51_41=?1@\x1d/4:" #() map!) map-int
- #fn("<000n2701E52340q:0E51qPq\x8a78786_421K1K~22870>253486:" #(<=
- #.for #fn("7000n1A<F051qPN4AA<=_:" #())) map-int)
+ #fn(";000n2701E52340q:0E51qPq\x8a78786_4K1K~21870>2|486:" #(<= #fn("7000n1A<F051qPN4AA<=_:" #())) map-int)
mark-label #fn("8000n270021163:" #(emit label) mark-label) max
#fn(";000z11J400:70210163:" #(foldl #fn("6000n201L3401:0:" #())) max)
member #fn("7000n21H340O:1<0d3401:7001=62:" #(member) member) memv
@@ -344,9 +343,9 @@
bounds-error "index " " out of bounds for " unbound-error "eval: variable "
" has no value" error "error: " load-error print-exception "in file " list?
#fn(string?) "*** Unhandled exception: " *linefeed*) print-exception)
- print-stack-trace #fn("@000n1DD\x8a5\x8a6852085>1_4862185>1_472730r3523F074075370r5@40r452@30051767728292:505252E\x8a92;2<868889>38762:" #(#fn(">000n32005182P2105121151C?022232487e361:2505126E77288851512988A187>463:" #(#fn(function:name)
- #fn(function:code) #fn(raise) thrown-value ffound #fn(function:vals) #.for 1-
- #fn(length) #fn("8000n170A0G513>0F<A0G929363:D:" #(closure?))) find-in-f)
+ print-stack-trace #fn("@000n1DD\x8a5\x8a6852085>1_4862185>1_472730r3523F074075370r5@40r452@30051767728292:505252E\x8a92;2<868889>38762:" #(#fn("=000n32005182P2105121151C?022232487e361:25051E76278851512888A187>4|:" #(#fn(function:name)
+ #fn(function:code) #fn(raise) thrown-value ffound #fn(function:vals) 1- #fn(length)
+ #fn("8000n170A0G513>0F<A0G929363:D:" #(closure?))) find-in-f)
#fn(";000n220A01>321{863I02273247576865152275261:28:" #(#fn("8000n02021AF>292524O:" #(#fn(for-each)
#fn("8000n1A<0Fq63:" #()))) #fn("6000n10B;3B040<20Q;38040T21Q38072061:23061:" #(thrown-value
ffound caddr #fn(raise))) #fn(symbol) string-join #fn(map) string reverse! "/"
@@ -444,10 +443,11 @@
#fn(":000n32021182>2072230515163:" #(#fn(map)
#fn("9000n2700210A52SS1FM63:" #(vinfo
#fn(memq))) iota #fn(length)) vars-to-env)
- vector->list #fn("=000n120051q\x8a621K852286085>353486<:" #(#fn(length)
- #.for #fn("8000n1AF920~GA<P_:" #())) vector->list)
- vector-map #fn("=000n22015121865122E86K~238701>353487:" #(#fn(length)
- #fn(vector-alloc) #.for #fn("9000n1A0F920G51p:" #())) vector-map)
+ vector->list #fn("<000n120051q\x8a6K852186085>3|486<:" #(#fn(length)
+ #fn("8000n1AF920~GA<P_:" #())) vector->list)
+ vector-map #fn("<000n220151218651E86K~228701>3|487:" #(#fn(length)
+ #fn(vector-alloc)
+ #fn("9000n1A0F920G51p:" #())) vector-map)
vinfo #fn("7000n30182e3:" #() vinfo) vinfo:heap? #.cadr vinfo:index
#2# vinfo:sym #.car void
#fn("5000n0D:" #() void) zero? #fn("6000n10El:" #() zero?))