History

#t: replace with just t (or T)

Sigrid Solveig Haflínudóttir committed 1 year ago

Commit 5ab7fa91 parent 4d79d1e18 files · +151 −174Browse files

Unified · Split

18 files
  1. README.md +1 −0
  2. boot/flisp.boot +1 −1
  3. boot/flisp.boot.builtin +0 −0
  4. src/compiler.lsp +14 −16
  5. src/docs_extra.lsp +2 −2
  6. src/flisp.c +1 −3
  7. src/flisp.h +1 −1
  8. src/print.c +2 −2
  9. src/read.c +16 −9
  10. src/system.lsp +29 −30
  11. test/ast/asttools.lsp +38 −38
  12. test/ast/match.lsp +13 −13
  13. test/ast/rpasses.lsp +6 −6
  14. test/hashtest.lsp +0 −24
  15. test/test.lsp +4 −6
  16. test/tme.lsp +2 −2
  17. test/unittest.lsp +19 −19
  18. tools/gen.lsp +3 −3
README.md+1−0
@@ -24,6 +24,7 @@ Some of the changes from the original include: · 23 unmodified lines
24 * `[` and `]`, `{` and `}` are synonyms to `(` and `)`24 * `[` and `]`, `{` and `}` are synonyms to `(` and `)`
25 * `define` → `def`, `define-macro` → `defmacro`25 * `define` → `def`, `define-macro` → `defmacro`
26 * `λ` as a shorthand for `lambda`26 * `λ` as a shorthand for `lambda`
27 * `t`/`T` instead of `#t`/`#T` and `nil` instead of `#f`
27 * docstrings - `(def (f ...) "Docs here" ...)` and `(help ...)`28 * docstrings - `(def (f ...) "Docs here" ...)` and `(help ...)`
28 * automatic gensyms for macros (`blah#`) at read time29 * automatic gensyms for macros (`blah#`) at read time
29 * proper `(void)` and `void?`30 * proper `(void)` and `void?`
boot/flisp.boot+1−1
@@ -1 +1 @@
1(*builtins* #(nil nil nil nil nil nil nil nil nil nil nil nil #fn("5000n10<:" #()) #fn("5000n10=:" #()) nil nil nil nil #fn("5000n10B:" #()) nil nil nil nil nil #fn("5000n10H:" #()) nil nil nil #fn("8000z0700}2:" #(<)) nil #fn("6000n201N:" #()) nil #fn("6000n201P:" #()) #fn("6000n201Q:" #()) #fn("5000n10R:" #()) #fn("5000n10S:" #()) #fn("5000n10T:" #()) nil #fn("5000n10V:" #()) nil #fn("5000n10X:" #()) #fn("5000n10Y:" #()) #fn("5000n10Z:" #()) #fn("5000n10[:" #()) #fn("5000n10\\:" #()) #fn("5000n10]:" #()) nil #fn("6000n201_:" #()) nil nil nil #fn("6000n201c:" #()) #fn("6000n201d:" #()) #fn("7000z00:" #()) #fn("8000z0700}2:" #(apply)) #fn("8000z0700}2:" #(+)) #fn("8000z0700}2:" #(-)) #fn("8000z0700}2:" #(*)) #fn("8000z0700}2:" #(/)) #fn("8000z0700}2:" #(div0)) #fn("8000z0700}2:" #(=)) #fn("6000n201m:" #()) nil #fn("8000z0700}2:" #(vector)) #fn("8000z0700}2:" #(aset!)) nil nil nil nil nil nil nil nil nil nil nil #fn("9000n3012082>1|:" #(#fn("6000n1A061:" #()))) nil nil nil nil nil nil nil nil #fn("8000z0700}2:" #(aref)) nil nil nil) *properties* #table(*funvars* #table(*prompt* (nil) lz-unpack (#t #t) void? ((x)) >= ((a . rest)) rand-uint64 (#t) help ((term)) length= ((lst n)) = (#t) car (#t) <= ((a . rest)) rand-uint32 (#t) /= ((a . rest)) void (rest) lz-pack (#t) rand (#t) nan? (#t) rand-float (#t) cons? (#t) vm-stats (#t) * (#t) rand-double (#t) cdr (#t) + (#t) > ((a . rest))) *doc* #table(>= "Return #t if the arguments are in non-increasing order (previous\none is greater than or equal to the next one)." void? "Return #t if x is #<void> and nil otherwise." length= "Bounded length test.\nUse this instead of (= (length lst) n), since it avoids unnecessary\nwork and always terminates." car "Returns the first element of a list or nil if not available." *builtins* "VM instructions as closures." <= "Return #t if the arguments are in non-decreasing order (previous\none is less than or equal to the next one)." void "Return the constant #<void> while ignoring any arguments.\n#<void> is mainly used when a function has side effects but does not\nproduce any meaningful value to return, so even though #t or nil could\nbe returned instead, in case of #<void> alone, REPL will not print\nit." rand "Return a random non-negative fixnum on its maximum range." nan? "Return #t if the argument is NaN, regardless of the sign." Instructions "VM instructions mapped to their encoded byte representation." rand-double "Return a random double on [0.0, 1.0] interval." > "Return #t if the arguments are in strictly decreasing order (previous\none is greater than the next one)." cdr "Returns the tail of a list or nil if not available." + "Return sum of the numbers or 0 with no arguments." lz-unpack "Return decompressed data previously compressed using lz-pack.\nEither destination for the decompressed data or the expected size of\nthe decompressed data must be specified. In the latter case a new\narray is allocated." rand-uint64 "Return a random integer on [0, 2⁶⁴-1] interval." help "Display documentation for the specified term, if available." = "Return #t if the arguments are equal." rand-uint32 "Return a random integer on [0, 2³²-1] interval." /= "Return #t if not all arguments are equal. Shorthand for (not (= …))." lz-pack "Return data compressed using Lempel-Ziv.\nThe data must be an array, returned value will have the same type.\nThe optional level is between 0 and 10. With level 0 a simple LZSS\nusing hashing will be performed. Levels between 1 and 9 offer a\ntrade-off between time/space and ratio. Level 10 is optimal but very\nslow." rand-float "Return a random float on [0.0, 1.0] interval." arg-counts "VM instructions mapped to their expected arguments count." *prompt* "Function called by REPL to signal the user input is required.\nDefault function prints \"#;> \"." cons? "Returns #t if the value is a cons cell." vm-stats "Print various VM-related information, such as the number of GC calls\nso far, heap and stack size, etc." * "Return product of the numbers or 1 with no arguments." *properties* "All properties of symbols recorded with putprop are recorded in this table.")) *syntax-environment* #table(bcode:nconst #fn("7000n1200r2e3:" #(aref)) doc-for #fn("@000\x8710002000W1000J60q?140B;35040<;J40402086510B88JI087\\3?07122862353@30q@F087\\360q@<071228624534252686e2261e22688e2e4:" #(#fn(top-level-value) error "docs: " ": no funvars specified" ": funvars set but isn't a function" symbol-set-doc quote)) with-input-from #fn("<000z12021e1220e2e1e12315163:" #(#fn(nconc) with-bindings *input-stream* #fn(copy-list))) unless #fn("<000z1200q211Pe4:" #(if begin)) defmacro #fn("A000z170151863D0710<860=5341=?1@30q42223240<e22526e10=e12715153e3e2:" #(value-get-doc symbol-set-doc void set-syntax! quote #fn(nconc) λ #fn(copy-list))) time #fn("=000n1202122e1e2e123024252622e121e32728e5e3e3:" #(let #:g357 time-now prog1 princ "Elapsed time: " - " seconds" *linefeed*)) cond #fn(";000z0Ib520852185>1_51485<061:" #(#0=#fn("7000z0I:" #() void) #fn(">000n10H340q:0<85<20Q;J80485<DQ3C085=J6085<:2185=P:85=J@02285<A<0=51e3:85T23C\x94074758551513c07675855151278685<e2e12886217975855151PA<0=51e4e3:272:85<e2e1282:7585512:e2A<0=51e4e3:2885<2185=PA<0=51e4:" #(else begin or => 1arg-lambda? caddr caadr let if cddr #:g25) cond-clauses->if))) do #fn("I000z21<2071052207205220230522425268827872829e12:1=51522829e12:82512825e18:52e153e4e3e2e12825e18952e3:" #(#fn(map) car cadr #fn("6000n170051B38071061:0<:" #(cddr caddr)) letrec #:g327 λ if #fn(nconc) begin #fn(copy-list))) mark-label #fn("8000n22002122e21e4:" #(emit quote label)) with-bindings #fn("G000z12071052207205220230522425e12076888653e12720288687535129242:e12715152242:e127202;8688535152e3e164:" #(#fn(map) car cadr #fn("5000n12060:" #(#fn(gensym))) #fn(nconc) let list #fn(copy-list) #fn("7000n22001e3:" #(set!)) unwind-protect begin #fn("7000n22001e3:" #(set!)))) let #fn(">000z1q0R3B00?641<?041=?1@30q42021e12223052e124151532225052863C0268687e2e186e3@408788P:" #(#fn(nconc) λ #fn(map) #fn("5000n10B3500<:0:" #()) #fn(copy-list) #fn("5000n10B3500T:7060:" #(void)) letrec)) bcode:code #fn("7000n1200Ee3:" #(aref)) make-label #fn("5000n120e1:" #(gensym)) bcode:cenv #fn("7000n1200r3e3:" #(aref)) > #fn("<000z12021e12273151510e163:" #(#fn(nconc) < #fn(copy-list) reverse!)) when #fn(";000z1200211Pqe4:" #(if begin)) quasiquote #fn("7000n1700E62:" #(bq-process)) help #fn(";000n17002152853W072855147350424250>170026q535247350@B0722728051524735047960:" #(getprop *doc* princ newline #fn(for-each) #fn("7000n17050471A0P61:" #(newline print)) *funvars* "no help for " #fn(string) void)) bcode:ctable #fn("7000n1200Ke3:" #(aref)) with-output-to #fn("<000z12021e1220e2e1e12315163:" #(#fn(nconc) with-bindings *output-stream* #fn(copy-list))) catch #fn("?000n22012122e123242522e2262722e22829e2e3262:22e20e3e42;22e22<22e2e4e3e3:" #(trycatch λ #:g352 if and cons? eq? car quote thrown-value cadr caddr raise)) let* #fn("@000z10H3E02021e1qe12215153e1:2021e173051e1e1220=B3H02024e10=e12215153e1@301515375051e2:" #(#fn(nconc) λ #fn(copy-list) caar let* cadar)) letrec #fn(">000z1202021e12273052e122240522515154e1227605262:" #(#fn(nconc) λ #fn(map) car #fn("8000n12021e12205162:" #(#fn(nconc) set! #fn(copy-list))) #fn(copy-list) void)) /= #fn("=000z1202122e10e12315153e2:" #(not #fn(nconc) = #fn(copy-list))) bcode:sp #fn("7000n1200r4e3:" #(aref)) bcode:stack #fn(":000n2200r421220e21e3e4:" #(aset! + bcode:sp)) assert #fn(";000n1200D2122230e2e2e2e4:" #(if raise quote assert-failed)) case #fn("A000z1Ib6208621_514225023870e2e12425e126278687>215252e3:" #(#0# #fn("8000n2120C5020:1J40q:1R3=021072151e3:1H3=023072151e3:1=J>0230721<51e3:74751523=0260271e2e3:280271e2e3:" #(else eq? quote-value eqv? every symbol? memq quote memv) vals->cond) #fn(gensym) let #fn(nconc) cond #fn(map) #fn("7000n1A<F0<520=P:" #()))) receive #fn("?000z22021q1e32221e10e123825153e3:" #(call-with-values λ #fn(nconc) #fn(copy-list))) unwind-protect #fn("?000n2202122q1e3e2e1232402225e12621e12725e2e3e3e321e1e3e3:" #(let #:g353 λ prog1 trycatch #:g354 begin raise)) dotimes #fn("A000z10<0T20E2187Ke32223e186e1e12415153e4:" #(for - #fn(nconc) λ #fn(copy-list))) throw #fn("9000n220212223e201e4e2:" #(raise list quote thrown-value))) 1+ #fn("6000n10KM:" #() 1+) 1- #fn("6000n10K~:" #() 1-) 1arg-lambda? #fn("7000n10B;3E04700<51;3:04710TK62:" #(is-lambda? length=) 1arg-lambda?) <= #fn(";000z1Ib6862086>1_486<^10162:" #(#fn("7000n21S;JL041<0L2;J5040V340q:A<1<1=62:" #())) <=) > #fn(";000z1Ib6862086>1_486<^10162:" #(#fn("7000n21S;JE041<0L2;3;04A<1<1=62:" #())) >) >= #fn(";000z1Ib6862086>1_486<^10162:" #(#fn("7000n21S;JL0401<L2;J5040V340q:A<1<1=62:" #())) >=) Instructions #table(call.l 81 trycatch 75 largc 79 loadg.l 68 aref2 23 box 50 cadr 36 argc 62 setg 71 load0 21 nan? 38 vector? 45 fixnum? 41 loadc0 17 loada0 0 div0 59 keyargs 31 call 5 loada.l 69 sub2 78 add2 29 loadc.l 70 loadc 9 builtin? 43 set-car! 47 ret 10 loadi8 66 tapply 77 loadvoid 25 loada1 1 shift 46 atom? 24 cdr 13 brne.l 83 / 58 equal? 52 apply 54 dup 11 loadt 20 jmp.l 48 = 60 not 35 set-cdr! 30 eq? 33 * 57 load1 27 bound? 42 function? 44 box.l 86 < 28 brnn.l 84 jmp 16 loadv 2 for 76 lvargc 80 dummy_eof 88 + 55 brne 19 compare 61 brn 3 neg 37 number? 40 loadv.l 67 vargc 74 brbound 39 vector 63 loadc1 22 setg.l 72 cons? 18 aref 85 symbol? 34 aset! 64 car 12 cons 32 tcall.l 82 - 56 brn.l 49 optargs 87 closure 14 pop 4 eqv? 51 list 53 seta 15 seta.l 73 brnn 26 loadnil 65 loadg 7 loada 8 tcall 6) __init_globals #fn("7000n07021d37022@402384w4^147025d;350426;J50427w8429w:47;w<47=w>47?w@:" #(*os-name* "macos" #fn("6000n0702161:" #(princ "\e[0m\e[1m#;> \e[0m")) #fn("6000n0702161:" #(princ "#;> ")) *prompt* "dos" "\\" "/" *directory-separator* "\n" *linefeed* *stdout* *output-stream* *stdin* *input-stream* *stderr* *error-stream*) __init_globals) __rcscript #fn("=000n0708421c360q@T08422c37023@G08424c3=07526514q@4027^184;390428845185;3=0429857:2;53863B02<86513907=8661:q:" #(*os-name* "unknown" "plan9" "home" "macos" princ "\e]0;femtolisp v0.999\a" "HOME" #fn(os-getenv) #fn(string) *directory-separator* ".flisprc" #fn(path-exists?) load) __rcscript) __script #fn("6000n1200>121{:" #(#fn("6000n070A61:" #(load)) #fn("6000n170051421K61:" #(top-level-exception-handler #fn(exit)))) __script) __start #fn("7000n1705040=B3D00=w14qw24730T51@C00w14Dw24745047550426E61:" #(__init_globals *argv* *interactive* __script __rcscript repl #fn(exit)) __start) abs #fn("6000n10EL23500U:0:" #() abs) any #fn("7000n21B;3D0401<51;J:047001=62:" #(any) any) arg-counts #table(bound? 1 function? 1 symbol? 1 car 1 cons 2 cadr 1 nan? 1 for 3 fixnum? 1 vector? 1 cdr 1 atom? 1 div0 2 equal? 2 eqv? 2 compare 2 not 1 number? 1 set-cdr! 2 eq? 2 builtin? 1 cons? 1 set-car! 2) argc-error #fn(";000n2702102211Kl237023@402465:" #(error "compile error: " " expects " " argument." " arguments.") argc-error) array? #fn("7000n10];JF042005185B;390485<21Q:" #(#fn(typeof) array) array?) assoc #fn("7000n2701510d3501<:13:07101=62:q:" #(caar assoc) assoc) assv #fn("7000n2701510c3501<:13:07101=62:q:" #(caar assv) assv) bcode:indexfor #fn(";000n20KG0r2G20861523:02186162:2286187534870r287KMp4:" #(#fn(has?) #fn(get) #fn(put!)) bcode:indexfor) box-vars #fn("9000n2Ib68620086>2_486<^1161:" #(#fn("9000n10B3Q00<T3B070A21720<5153@30q4F<0=61:q:" #(emit box caddr))) box-vars) bq-bracket #fn(";000n20H3=070710152e2:0<22CS01El2380700=P:707324710=1K~52e3e2:0<25CT01El2390260Te2:707027710T1K~52e3e2:0<28CP01El23500T:707029710T1K~52e3e2:70710152e2:" #(list bq-process unquote cons 'unquote unquote-splicing copy-list 'unquote-splicing unquote-nsplicing 'unquote-nsplicing) bq-bracket) bq-bracket1 #fn(":000n20B3S00<20CL01El23500T:7122730=1K~52e3:730162:" #(unquote cons 'unquote bq-process) bq-bracket1) bq-process #fn("<000n20R380200e2:0]3T0717205115286<73C907486=P:757486e3:0H3400:0<26CB07327710T1KM52e3:0<28CV01El23?0790r2523500T:7:2;710=1K~52e3:7<7=052Jt07>0512?2@1>105286J807387P:87=JA07:87<7186152e3:2A7B87P7186152e162:Ib6862C186>2_486<^10q62:" #(quote bq-process vector->list list vector apply quasiquote 'quasiquote unquote length= cons 'unquote any splice-form? lastcdr #fn(map) #fn("7000n1700A62:" #(bq-bracket1)) #fn(nconc) list* #fn("=000n20J;02071151P:0B3o00<22CX020731AEl23700=@C07425e2760=AK~52e252P:F<0=770<A521P62:2071760A521P51P:" #(nconc reverse! unquote nreconc list 'unquote bq-process bq-bracket))) bq-process) builtin->instruction #fn("8000n120A0q63:" #(#fn(get)) #(#table(#.cadr cadr #.aset! aset! #.+ + #.- - #.equal? equal? #.eq? eq? #.builtin? builtin? #.not not #.cons? cons? #.cdr cdr #./ / #.div0 div0 #.set-car! set-car! #.vector vector #.set-cdr! set-cdr! #.< < #.aref aref #.for for #.cons cons #.apply apply #.eqv? eqv? #.vector? vector? #.list list #.car car #.bound? bound? #.nan? nan? #.function? function? #.symbol? symbol? #.compare compare #.fixnum? fixnum? #.atom? atom? #.= = #.number? number? #.* *))) caaaar #fn("5000n10<<<<:" #() caaaar) caaadr #fn("5000n10T<<:" #() caaadr) caaar #fn("5000n10<<<:" #() caaar) caadar #fn("5000n10<T<:" #() caadar) caaddr #fn("5000n10=T<:" #() caaddr) caadr #fn("5000n10T<:" #() caadr) caar #fn("5000n10<<:" #() caar) cadaar #fn("5000n10<<T:" #() cadaar) cadadr #fn("5000n10TT:" #() cadadr) cadar #fn("5000n10<T:" #() cadar) caddar #fn("5000n10<=T:" #() caddar) cadddr #fn("5000n10==T:" #() cadddr) caddr #4=#fn("5000n10=T:" #() caddr) call-with-values #fn("7000n205086B3@0A86<C90186=}2:18661:" #() #(#3=(*values*))) capture-var! #fn("<000n20r3G70186E5387;JG042186510r322861e152p4:" #(index-of #fn(length) #fn(nconc)) capture-var!) cdaaar #fn("5000n10<<<=:" #() cdaaar) cdaadr #fn("5000n10T<=:" #() cdaadr) cdaar #fn("5000n10<<=:" #() cdaar) cdadar #fn("5000n10<T=:" #() cdadar) cdaddr #fn("5000n10=T=:" #() cdaddr) cdadr #fn("5000n10T=:" #() cdadr) cdar #fn("5000n10<=:" #() cdar) cddaar #fn("5000n10<<==:" #() cddaar) cddadr #fn("5000n10T==:" #() cddadr) cddar #fn("5000n10<==:" #() cddar) cdddar #fn("5000n10<===:" #() cdddar) cddddr #fn("5000n10====:" #() cddddr) cdddr #fn("5000n10===:" #() cdddr) cddr #fn("5000n10==:" #() cddr) char? #fn("6000n12005121Q:" #(#fn(typeof) rune) char?) closure? #fn("6000n10\\;36040[S:" #() closure?) compile #fn("8000n170q7105162:" #(compile-f lower-define) compile) compile-and #fn("<000n570018283D218467:" #(compile-short-circuit brn) compile-and) compile-app #fn("E000n483<88R3U07088152JK088Z3E0218851[3;0218851@40887283=23523q07401q895440r40r4GKMp4750183=530r40r4G8:UMp47608237027@40288:63:89[;3904798951892:Cf07089152J\\0212:517:d3P07;83r2523E07401q83T5447602:62:89B3P07<89<513F07=83513=07>01828364:8:360q@F07401q895440r40r4GKMp4750183=530r40r4G8;UMp48:360q@=00r40r4Gr/Mp48:3C07?018283898:8;67:760823702@@402A8;63:" #(in-env? #fn(top-level-value) length> 255 compile-in compile-arglist emit tcall.l call.l builtin->instruction cadr length= is-lambda? inlineable? compile-let compile-builtin-call tcall call) compile-app) compile-arglist #fn("8000n3202101>282524228261:" #(#fn(for-each) #fn("9000n170AFq0544Ar4Ar4GKMp:" #(compile-in)) #fn(length)) compile-arglist) compile-aset! #fn("=000n3208251r2~87Kl23?07101q2282P64:K87L23h07101q2374828752P544750176828752530r40r4G88UMp47702262:7822r362:" #(#fn(length) compile-app aset! aref list-head compile-arglist list-tail emit argc-error) compile-aset!) compile-begin #fn("9000n483H3?0700182715064:83=H3>070018283<64:7001q83<5447202352474018283=64:" #(compile-in void emit pop compile-begin) compile-begin) compile-builtin-call #fn(">000n7I202186850>3?;514227385q538<3I07483=8<52J=075858<52@30q4858=26CL086El23:07702862:770858663:8=29C708;60:8=2:C708;60:8=2;C]086El23:07702<62:86r2l23:07702=62:770858663:8=2>Cm086El23:07585K62:86Kl23:07702?62:86r2l23:07702@62:770858663:8=2ACL086El23:07702B62:770858663:8=2CCL086El23:07585K62:770858663:8=2DCN086El23<07702E2F63:770858663:8=2GCX086r2L23;07585r262:770823702H@402G8663:8=2ICb086r2l23:07702J62:r286L23?07708586r3~63:7585r262:7708562:" #(#0# #fn("8000n0AEl239070FK62:7192FA63:" #(argc-error emit) num-compare) #fn(get) arg-counts length= argc-error list emit loadnil < = + load0 add2 - neg sub2 * load1 / vector loadv #() apply tapply aref aref2) compile-builtin-call) compile-f #fn("8000n2702101>22262:" #(call-with-values #fn("7000n070AF62:" #(compile-f-)) #fn("5000n20:" #())) compile-f) compile-f- #fn("O000n270501T711T517215173741T52711518;J7025@408;87H360E@802687518=268:51~73778:528:3\xa208?JL07886298>883808=U@408=54@r07:867;2<7=2<7>8?527?268?5151535152478862@8>268?51883808=U@408=5547A8608:898>55@30q42B8=L23I07886883702C@402D8=53@W0883?078862E8=53@E08:J?078862F8=53@30q47G0897H7I1518952537J868@<52486r4268951r4Mp47K868@D7I15154478862L5247M2N7O86EG517P86518<5386r3G62:" #(make-code-emitter lastcdr lambda:vars filter cons? λ #fn(length) keyword-arg? emit optargs bcode:indexfor make-perfect-hash-table #fn(map) cons car iota keyargs emit-optional-arg-inits 255 lvargc largc vargc argc extend-env complex-bindings lambda:body box-vars compile-in ret values #fn(function) encode-byte-code const-to-idx-vec) compile-f-) compile-if #fn("A000n420502050205083T718351728351B3;0738351@30q8;DC=07401828<64:8;qC=07401828=64:7401q8;89554750268953475027885347401828<544823<07502852@;0750298:53475027895347401828=544750278:63:" #(#fn(gensym) caddr cdddr cadddr compile-in emit brn label ret jmp) compile-if) compile-in #fn("B000\x8740005000W4000J60q?4483R3<0700183D64:83H3\x98083EC:07102262:83KC:07102362:83DC:07102462:83qC:07102562:7683513:07102762:7883513<0710298363:7102:8363:83<2;C<07<0183=63:83<RS;JD0483<Z;J;047=83<1523=07>01828364:83<892?CS07@83T513>07A018283T64:7102:83T63:892BC=07C01828364:892DC>07E018283=64:892FC;07G018363:892HCD07I2J183>22K01>262:892LC@07M018283=8465:892NC>07O018283=64:892PCE07Q0183T2D7R8351P64:892SCE07A01D83T5447102T62:892UC\x93083T7R83517V8;518:R360q@807W2X5148<3`08;=?;47Y8:8<8;<B;3G047Z8;<<51;3:047[8;<5153@30q47\\018:8;<64:892]Cp07A01q2Hq83Te35447^7_835151360q@807W2`5147A01q7_83515447102]62:7>01828364:" #(compile-sym emit load0 load1 loadt loadnil void? loadvoid fits-i8 loadi8 loadv aset! compile-aset! in-env? compile-app quote self-evaluating? compile-in if compile-if begin compile-begin prog1 compile-prog1 λ call-with-values #fn("7000n070AF62:" #(compile-f-)) #fn("9000n270A21053413K02223AF>2152470A242515163:q:" #(emit loadv #fn(for-each) #fn("9000n170AF0q64:" #(compile-sym)) closure #fn(length))) and compile-and or compile-or while compile-while cddr return ret set! value-get-doc error "set!: name must be a symbol" symbol-set-doc is-lambda? lambda:vars compile-set! trycatch 1arg-lambda? caddr "trycatch: second form must be a 1-argument lambda") compile-in) compile-let #fn("A000n483<83=0r4G88T70018953718;727388518;528:537408=524258=1<521=P7608>827388515440r40r4G8<UMp4E8<L23A082J<0770288<63:q:" #(compile-arglist vars-to-env complex-bindings caddr box-vars #fn(nconc) compile-in emit shift) compile-let) compile-or #fn("<000n470018283q21q67:" #(compile-short-circuit brnn) compile-or) compile-prog1 #fn(":000n37001q82T544718251B3_00r40r4GKMp47201q718251544730245240r40r4Gr/Mp:q:" #(compile-in cddr compile-begin emit pop) compile-prog1) compile-set! #fn("?000n470821E538821CF07201q83544730248263:88<El288=T893<07588=51@9076082528:3o07308937027@40288;5340r40r4GKMp47201q835440r40r4Gr/Mp47302962:7201q8354489JA07:2;2<825251@30q47302=8;63:" #(lookup-sym global compile-in emit setg vinfo:index capture-var! loada loadc set-car! error #fn(string) "internal error: misallocated var " seta) compile-set!) compile-short-circuit #fn("?000n783H3?0700182848665:83=H3@070018283<8665:86;J70421507001q83<865540r40r4GKMp486360q@9072023524720858;5340r40r4Gr/Mp486360q@907202452475018283=84858657486340q:720268;63:" #(compile-in #fn(gensym) emit dup pop compile-short-circuit label) compile-short-circuit) compile-sym #fn(";000n470821E538821C`02282513M073248251513@07502624825163:750278263:88<El23W0750287988=51534833A088=T3:07502:62:q:7502;7<08252534833A088=T3:07502:62:q:" #(lookup-sym global #fn(constant?) printable? #fn(top-level-value) emit loadv loadg loada vinfo:index car loadc capture-var!) compile-sym) compile-thunk #fn(":000n170q21q72051e362:" #(compile-f λ lower-define) compile-thunk) compile-while #fn(";000n4205020507101q72505440r40r4GKMp473024885347101q825447302589534730265240r40r4Gr/Mp47101q835447302788534730248963:" #(#fn(gensym) compile-in void emit label brn pop jmp) compile-while) complex-bindings #fn("=000n2205020507101qq8687564722386>174875162:" #(#fn(table) complex-bindings- filter #fn("7000n120A062:" #(#fn(has?))) table-keys) complex-bindings) complex-bindings- #fn("=000n61J40q:0R3K0833D02001523;021840D63:q:0H;J80472051340q:0<23Co0200T1523Q021850TD534833>021840TD53@30q@30q474750511q83848566:760<513U074770517817905152q82S;J50483848566:740<17:051838485562;2<1838485>40=52P:" #(#fn(memq) #fn(put!) quoted? set! complex-bindings- caddr is-lambda? lambda:body diff lambda:vars inlineable? #fn(map) #fn(";000n1700AqF929366:" #(complex-bindings-))) complex-bindings-) const-to-idx-vec #fn("9000n1200r2G51212285>10KG52485:" #(#fn(vector-alloc) #fn(for-each) #fn("7000n2A10p:" #())) const-to-idx-vec) copy-tree #fn("7000n10H3400:700<51700=51P:" #(copy-tree) copy-tree) count #fn("9000n2Ib620862186>1_51486<01E63:" #(#0# #fn("9000n31J5082:A<01=01<5139082KM@408263:" #() count-)) count) delete-duplicates #fn(":000n1700rD523O02150Ib686228586>2_486<^10q62:0H3400:0<0=73858652390748661:85748651P:" #(length> #fn(table) #fn("8000n20H38070161:21A0<523:0F<0=162:22A0<D534F<0=0<1P62:" #(reverse! #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("U000\x871000.///W1000J60q?14z282JG07001E534715047260:@30q482<2305124051II252687>1?:5142527187>2?;514r4288851b<I8<<8=L23\x9124292:888<>2q7;53r48<<L23907150@30q4E87K~2<|48<8<<KM_48>2=8?2>523[08;8>8<<r45348:897?888<<52G5148<8<<r4M_@\x1f12=8?2@523V08;8>8<<K5348:89888<<GG5148<8<<KM_@\xf012=8?2A523e08;8>8<<K5347B2C888<<G8>2DC70r3@30EM515148<8<<KM_@\xb212=8?2E523\\08;8>8<<r45347B2C7?888<<52515148<8<<r4M_@}12=8?2F523\xb808;8>8<<r88>2GC70r4@30EM5347B2C7?888<<52512H5248<8<<r4M_47B2C7?888<<52515148<8<<r4M_48>2GCY07B2H5147B2C7?888<<52512H5248<8<<r4M_@30q@\xec08?2Ic3^08;8>8<<r45347B2C7?888<<52512H5248<8<<r4M_@\xb802=8?2J523e08;8>8<<r25347B2K7L8<<r,7M888<<52g3515248<8<<r2M_@z02=8?2N523e08;8>8<<r45347B2K7L8<<r,7?888<<52g3515248<8<<r4M_@<08;8>8<<E53^1^1@\xc9-:" #(disassemble newline void #fn(function:code) #fn(function:vals) #1=#fn("7000z0I:" #() void) #fn("9000n10\\3F00[JA070504710qAKM63:72061:" #(newline disassemble print) print-val) #fn(";000n370A3U0FEl23N071A72151523A0A182ML237023@4024751r5~512602765:" #(princ >= 1- " >" " " hex5 ": " " ") print-inst) #fn(length) #fn(table-foldl) #fn("7000n382;J?041AF<GQ;34040:" #()) 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 aref) princ #fn(number->string) aref (loada.l seta.l loadc.l largc lvargc call.l tcall.l box.l) (optargs keyargs) keyargs " " brbound (jmp brne brnn brn) "@" hex5 ref-int16-LE (jmp.l brne.l brnn.l brn.l)) disassemble) div #fn("7000n201k0EL2;3D041EL2;3404K;J504r/;J404EM:" #() div) emit #fn("N000z2I2021?75140EG82Jk0122CB088<23C:08824_@R0125CE08788<513;00E88=p@900E188Pp@D126127523A078082<52e1?2@30q42912:52893D02;82<L23:089T?1@30q^142912<52893D02;82<L23:089T?1@30q^1412=C\\0822>d3=02??14q?2@F0822@d3=02A?14q?2@30q@30q412BC\\0822>d3=02C?14q?2@F0822@d3=02D?14q?2@30q@30q488<12EQ;3b04892FCB00E82<2G88=PPp@J0892HCB00E82<2I88=PPp@30q;J@040E7J182P8852p^140:" #(#0# #fn("7000n17002162:" #(member (load0 load1 loadt loadf loadnil loadvoid)) load?) car cdr cadr pop #fn(memq) (loadv loadg setg) bcode:indexfor #fn(assq) ((loadv loadv.l) (loadg loadg.l) (setg setg.l) (loada loada.l) (seta seta.l) (box box.l)) 255 ((loadc loadc.l)) loada (0) loada0 (1) loada1 loadc loadc0 loadc1 brn not brnn eq? brne nreconc) emit) emit-optional-arg-inits #fn("<000n582B3\x91020507102284534710238953474075176838452q53q7782515447102884534710295247102:895347;0182=8384KM65:q:" #(#fn(gensym) emit brbound brnn compile-in extend-env list-head cadar seta pop label emit-optional-arg-inits) emit-optional-arg-inits) encode-byte-code #fn("P000n17005171855172238651r3238651r2ki2M2452238651E255025502650qq278<28524I8988L23\xc0148689G?=48=29CP02:8:8689KMG2;8<5153489r2M?9@\x8f1278<2<2=7>873k08=8D2?C702@@X08D2AC702B@L08D2CC702D@@08D2EC702F@408=^1@408=525152489KM?948988L2;38048689G?>42G8=2H523`02:8;2;8<518>534278<873707I@407JE5152489KM?9@\xeb08=2KCH0278<2L8>5152489KM?9@\xce08>X3\xc708=2G8?2M523H0278<2L8>5152489KM?9@\x9f02G8?2N523\x810278<2L8>5152489KM?94278<2L8689G5152489KM?948=2OCK0278<2L8689G5152489KM?9@30q@E0278<2P8>5152489KM?9^1@30q@\x9b.42Q2R8<878:>38;5242S8<61:" #(reverse! list->vector >= #fn(length) 65536 #fn(table) #fn(buffer) #fn(io-write) #int32(0) label #fn(put!) #fn(sizeof) #fn(byte) #fn(get) Instructions jmp jmp.l brne brne.l brnn brnn.l brn brn.l #fn(memq) (jmp brne brnn brn) int32 int16 brbound #fn(int32) (loadv.l loadg.l setg.l loada.l seta.l largc lvargc call.l tcall.l loadc.l box.l) (optargs keyargs) keyargs #fn(uint8) #fn(for-each) #fn(";000n220A052421AF37072@407324921520~5162:" #(#fn(io-seek) #fn(io-write) int32 int16 #fn(get))) #fn(iostream->string)) encode-byte-code) error #fn("9000z020210P61:" #(#fn(raise) error) error) eval #fn("7000n170710515160:" #(compile-thunk expand) eval) even? #fn("7000n1200K52El2:" #(#fn(logand)) even?) every #fn("7000n21H;JD0401<51;3:047001=62:" #(every) every) expand #fn("G000n1IIIIIIIIIIIb5b6b7b8b9b:b;b<b=b>b?208521_51420862286>1_514208723e1_51420882485868?87>4_5142089258?89>2_514208:268:>1_514208;278:8988>3_514208<288?8:8988>4_514208=29888?>2_514208>2:_514208?2;8?8>8;8<8=>5_5148?<0q62:" #(#0# #fn("7000n20Z;J904200152S:" #(#fn(assq)) top?) #fn("8000n10H3400:020d3400:0<B3P07105122CF023A<7405151A<0=5162:0<A<0=51P:" #(((begin)) caar begin #fn(append) cdar) splice-begin) *expanded* #fn("A000n20H3400:A<201523:0F<051@300A<21152873;0728651@30q2324758852152b987JA024269289>28662:Ib:8:278:928993>4_48:<^186518:I8;B3c0493<788;51QJC08;92<8;<89<52_@;08;798;51_48;=?;@\xfb/48::" #(begin def get-defined-vars #fn(nconc) #fn(map) list #fn("7000n1A<0F<62:" #()) #fn(";000n10H3400:0<B3F02071051C<00<A<0=51P:F<0<92<52922223747585515292<52_493<85PA<0=51P:" #(def caar #fn(nconc) #fn(map) list get-defined-vars)) caar cdar) expand-body) #fn("9000n20H3400:0<B3M00<=B3F070051A<71051152e2@400<F<0=152P:" #(caar cadar) expand-lambda-list) #fn("7000n10H3600e1:0<B3?070051A<0=51P:0<A<0=51P:" #(caar) l-vars) #fn("?000n20T7005171051A<0T5122237489521522225e1F<868:52e192<888:528764:" #(lastcdr cddr #fn(nconc) #fn(map) list λ) expand-lambda) #fn("D000n20=S;J6040TH3o070051J400:0T717005151873B00=?0472868752@30q42386A<74051152e3:750517605170051718851F<86512728798:52152893E088=?847287898653@30q42723e18792<868;52Pe193<888;5263:" #(cddr value-get-doc symbol-set-doc def caddr cdadr caadr #fn(nconc) #fn(map) list) expand-define) #fn("=000n20T20A<71051222324F1>2865215252P:" #(begin cddr #fn(nconc) #fn(map) #fn("9000n10<70A<0TF525150Fe3:" #(compile-thunk))) expand-let-syntax) #fn("5000n20:" #() local-expansion-env) #fn("<000n20H3400:0<208615221A10>3873P087=B3I0A<87T0=f2F<72875115262:73051893>0A<890=f2162:87;J?0486RS;J60486Z3708860:8624C400:8625C:092<0162:8625C:092<0162:8626C:093<0162:8627C:094<0162:8860:" #(#fn(assq) #fn(":000n0Ib48420AF84>3_484<^19261:" #(#fn("8000n10H3400:0<H3700<@90A<0<F5292<0=51P:" #()))) caddr macrocall? quote λ def let-syntax) expand-in)) expand) expand-define #fn("@000n10T70051B3:070051@H085R37021@=07223740515285R3@021258586<e3e2:212585<2627e185=e128865185<54e3e2:" #(cddr #1# error "compile error: invalid syntax " print-to-string set! #fn(nconc) λ #fn(copy-list)) expand-define) extend-env #fn("8000n370182E530P:" #(vars-to-env) extend-env) filter #fn("9000n2I20210>1?65148601qe163:" #(#0# #fn("8000n382I1B3Q04A1<513?0821<qPN=?2@30q41=?1@\x0e/4=:" #() filter-)) filter) fits-i8 #fn("8000n10Y;3<0470r\xaf0r\xb063:" #(>=) fits-i8) foldl #fn("9000n382J401:700082<15282=63:" #(foldl) foldl) foldr #fn(":000n382J401:082<700182=5362:" #(foldr) foldr) get-defined-vars #fn("7000n170A<05161:" #(delete-duplicates) #(#2=(#fn("8000n10H340q:0<20Cj00=B3d00TR;37040Te1;JS040TB;3E0471051R;3:0471051e1;J404q:0<22C?07324A<0=52}2:q:" #(def caadr begin nconc #fn(map)) #(#2#))))) getprop #fn(":000\x8720003000W2000J60q?2420711q5387;3<04208708253;J50482:" #(#fn(get) *properties*) getprop) hex5 #fn("8000n170210r@52r52263:" #(string-lpad #fn(number->string) #\0) hex5) identity #fn("5000n10:" #() identity) in-env? #fn("7000n21B;3F042001<52;J:047101=62:" #(#fn(assq) in-env?) in-env?) index-of #fn("9000n31J40q:01<C5082:7001=82KM63:" #(index-of) index-of) inlineable? #fn("9000n10<85B;3u047085<51;3i047185T51;3]04727385T52;3O047485T2552S;3@047685T270=5162:" #(is-lambda? list? every symbol? length> 255 length= #fn(length)) inlineable?) io-readall #fn("8000n1205021850524228561:" #(#fn(buffer) #fn(io-copy) #fn(iostream->string)) io-readall) io-readline #fn("7000n12002162:" #(#fn(io-readuntil) #\newline) io-readline) io-readlines #fn("7000n17071062:" #(read-all-of io-readline) io-readlines) iota #fn("7000n17071062:" #(map-int identity) iota) is-lambda? #fn("6000n1020Q;J704020Q:" #(λ) is-lambda?) keyword->symbol #fn(";000n1200513K021220512386K24865153^161:0:" #(#fn(keyword?) #fn(symbol) #fn(string) #fn(string-sub) #fn(string-length)) keyword->symbol) keyword-arg? #fn("6000n10B;3904200<61:" #(#fn(keyword?)) keyword-arg?) lambda-vars #fn(":000n1Ib520852185>1_51485<00qq54422237405162:" #(#0# #fn(":000n40S;J5040R340D:0B3Z00<R3T082;J504833<0702112263:A<0=1828364:0B3\x8d00<B3\x870730<r2523?074051R360q@=070250<2615442774051513=0A<0=182D64:833<0702112863:A<0=1D8364:0B3>070290<26164:01C:07021162:7029026164:" #(error "compile error: invalid argument list " ": optional arguments must come after required." length= caar "compile error: invalid optional argument " " in list " #fn(keyword?) ": keyword arguments must come last." "compile error: invalid formal argument ") check-formals) #fn(map) #fn("6000n10B390700<61:0:" #(keyword->symbol)) to-proper) lambda-vars) lambda:body #fn("6000n170061:" #(caddr) lambda:body) lambda:vars #fn("6000n1700T61:" #(lambda-vars) lambda:vars) last-pair #fn("6000n10=H3400:700=61:" #(last-pair) last-pair) lastcdr #fn("6000n10H3400:70051=:" #(last-pair) lastcdr) length= #fn("8000n21EL2340q:1El23500H:0H3701El2:700=1K~62:" #(length=) length=) length> #fn("8000n21EL23400:1El23;00B;34040:0H3701EL2:700=1K~62:" #(length>) length>) list->vector #fn("6000n1700}2:" #(vector) list->vector) list-head #fn("9000n2701E52340q:0<710=1K~52P:" #(<= list-head) list-head) list-ref #fn("7000n2700152<:" #(list-tail) list-ref) list-tail #fn("8000n2701E523400:710=1K~62:" #(<= list-tail) list-tail) list? #fn("6000n10S;J@040B;3904700=61:" #(list?) list?) load #fn("9000n120021522285>123850>2{:" #(#fn(file) :read #fn("9000n0Ib48420A84>2_484<^1III63:" #(#fn("9000n320A51JG0F<21A510721514735063:24A514737215161:" #(#fn(io-eof?) #fn(read) load-process void #fn(io-close))))) #fn("8000n120A5142122F0e361:" #(#fn(io-close) #fn(raise) load-error))) load) load-process #fn("6000n170061:" #(eval) load-process) lookup-sym #fn(";000n31J5020:1<2108752883808288P:7201=82KM63:" #(global #fn(assq) lookup-sym) lookup-sym) lower-define #fn(";000n1I2021?55140H;J804720513400:0<23C<0747505161:760<513K02728e10Te185051e17905164:2:74062:" #(#1# #fn("=000n170051B3N071051B3=02270051P@7073051@607450758551768551863D0278687e328748652P:87:" #(cddr cdddr begin caddr void get-defined-vars lower-define λ #fn(map)) λ-body) quoted? def lower-define expand-define is-lambda? #fn(nconc) λ lastcdr #fn(map)) lower-define) macrocall? #fn("6000n10<R;3904700<61:" #(symbol-syntax) macrocall?) macroexpand-1 #fn("7000n10H3400:7005185390850=}2:0:" #(macrocall?) macroexpand-1) make-code-emitter #fn("9000n0q2050EqEo5:" #(#fn(table)) make-code-emitter) make-perfect-hash-table #fn(";000n1Ib5208521_514Ib6862285860>3_486<^12305161:" #(#1# #fn("8000n270712205151162:" #(mod0 abs #fn(hash)) $hash-keyword) #fn("=000n120r20i2q52Ib68621A085F86>5_486<^19261:" #(#fn(vector-alloc) #fn(":000n10B3p070051r2A<85F52i29286G3;093<FKM61:928685p49286KM71051p494<0=61:92:" #(caar cdar)))) #fn(length)) make-perfect-hash-table) make-system-image #fn("@000n120021222354202402552212223542650277879qw84Dw942:898:>22;88878586>42<8;>1{8;504:" #(#fn(file) :write :create :truncate #fn(string) ".builtin" #fn(buffer) (*linefeed* *directory-separator* *argv* that *print-pretty* *print-width* *print-readably* *print-level* *print-length* *os-name* *interactive* *prompt* *os-version* procedure? top-level-bound?) *print-pretty* *print-readably* #fn("5000n0Aw04Fw1:" #(*print-pretty* *print-readably*)) #fn("?000n07021A>17223505152742576842577845253f22885F52428859252429927:52^1^142;F512<2=F51r:522>2?E2@2A84522B84r(522B84r 522B84r\x18525629938652429938552^1^1^142C925142C9361:" #(filter #fn("8000n10Z;3u0420051S;3j0421051[S;JC0422051222105151dS;3I04230A52S;3=04242105151S:" #(#fn(constant?) #fn(top-level-value) #fn(string) #fn(memq) #fn(iostream?))) simple-sort #fn(environment) nconc #fn(map) list top-level-value #fn(write) #fn(io-write) *linefeed* #fn(sizeof) #fn(lz-pack) #fn(iostream->string) #fn(array) byte #fn(logand) 255 #fn(ash) #fn(io-close))) #fn("6000n1A50420061:" #(#fn(raise)))) make-system-image) map! #fn("8000n21I1B3B04101<51_41=?1@\x1d/4:" #() map!) map-int #fn(";000n2701E52340q:0E51qPqb78786_4K7115122870>2|486:" #(<= 1- #fn("7000n1A<F051qPN4AA<=_:" #())) map-int) max #fn(";000z11J400:70210163:" #(foldl #fn("6000n201L23401:0:" #())) max) member #fn("7000n21<0d3401:13:07001=62:q:" #(member) member) memv #fn("7000n21<0c3401:13:07001=62:q:" #(memv) memv) min #fn(";000z11J400:70210163:" #(foldl #fn("6000n201L23400:1:" #())) min) mod #fn("8000n207001521i2~:" #(div) mod) mod0 #fn("7000n2001k1i2~:" #() mod0) negative? #fn("6000n10EL2:" #() negative?) nestlist #fn(":000n37082E52340q:1710015182K~53P:" #(<= nestlist) nestlist) newline #fn("8000\x8700001000W0000J7070?04210725247360:" #(*output-stream* #fn(io-write) *linefeed* void) newline) nreconc #fn("7000n2701062:" #(reverse!-) nreconc) odd? #fn("6000n170051S:" #(even?) odd?) partition #fn(":000n2I2021?65148601qe1qe164:" #(#0# #fn("9000n48283PI1B3Z0401<513?0821<qPN=?2@<0831<qPN=?341=?1@\x05/47088<=88==62:" #(values) partition-)) partition) positive? #fn("6000n1E0L2:" #() positive?) princ #fn(";000z070qw042185>1220>12386>1{86504:" #(*print-readably* #fn("5000n0Aw0:" #(*print-readably*)) #fn("7000n02071A62:" #(#fn(for-each) write)) #fn("6000n1A50420061:" #(#fn(raise)))) princ) print #fn("9000z02071062:" #(#fn(for-each) write) print) print-exception #fn("=000n10B3e00<20C^0710r3523T072230T2425760515127554787605151@\x0e00B3Z00<29CS0710r3523I0722:760512;534780T51@\xe100B3P00<2<CI0710r2523?0722=0T2>53@\xbe00B3I00<2?CB0722@514720=f2@\xa200B3N00<2ACG07B76051514722C0T52@\x8107D0513m0710r2523c0780<51472275140T2E8551;J60485R37072@40788551^1@>0722F514780514727G61:" #(type-error length= princ "type error: expected " ", got " #fn(typeof) caddr ": " print 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("@000n1IIb5b620852185>1_51420862285>1_51473740r3523F075076370r5@40r452@300517778292:2;505252Eb92<2=868889>38762:" #(#0# #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:q:" #(closure?))) find-in-f) #fn(":000n220A01>321{863E0722374758651522662:27:" #(#fn("8000n02021AF>292524q:" #(#fn(for-each) #fn("8000n1A<0Fq63:" #()))) #fn("6000n10B3F00<20C?00T21C8072061:23061:" #(thrown-value ffound caddr #fn(raise))) string-join #fn(map) string reverse! "/" "λ") fn-name) reverse! length> list-tail *interactive* filter closure? #fn(map) #fn("6000n10Z;380420061:" #(#fn(top-level-value))) #fn(environment) #fn(for-each) #fn("9000n17021A<0KGF52524222374051==52470257652492<El23?0770KG0EG52@30q49292<KM_:" #(princ "(" #fn(for-each) #fn("6000n1702151472061:" #(princ " " print)) vector->list ")" *linefeed* disassemble))) print-stack-trace) print-to-string #fn("8000n1205021085524228561:" #(#fn(buffer) #fn(write) #fn(iostream->string)) print-to-string) printable? #fn("6000n120051;JB0471051;J80422051S:" #(#fn(iostream?) void? #fn(eof-object?)) printable?) putprop #fn(";000n320711q5387360q@F02250237118853488?7^14238708253482:" #(#fn(get) *properties* #fn(table) #fn(put!)) putprop) quote-value #fn("6000n1700513400:210e2:" #(self-evaluating? quote) quote-value) quoted? #fn("6000n10<20Q:" #(quote) quoted?) random #fn("7000n1200513<0712250062:23500i2:" #(#fn(integer?) mod #fn(rand) #fn(rand-double)) random) read-all #fn("7000n17071062:" #(read-all-of read) read-all) read-all-of #fn(":000n2Ib686201860>3_486<^1q015162:" #(#fn("8000n220A5138071061:F<10P92A5162:" #(#fn(io-eof?) reverse!))) read-all-of) ref-int16-LE #fn(":000n2202101EMGE522101KMGr852M61:" #(#fn(int16) #fn(ash)) ref-int16-LE) ref-int32-LE #fn("<000n2202101EMGE522101KMGr8522101r2MGr@522101r3MGrH52g461:" #(#fn(int32) #fn(ash)) ref-int32-LE) remprop #fn("8000n220711q5386;3F042286052;3:042386062:" #(#fn(get) *properties* #fn(has?) #fn(del!)) remprop) repl #fn(";000n0IIb4b5208421_5142085228485>2_51485<5047360:" #(#0# #fn("9000n07050421725142324{257651S;3Z04778451788551360q@=079855147:5047;85w<61:" #(*prompt* #fn(io-flush) *output-stream* #fn("5000n02060:" #(#fn(read))) #fn("6000n1207151422061:" #(#fn(io-discardbuffer) *input-stream* #fn(raise))) #fn(io-eof?) *input-stream* load-process void? print newline void that) prompt) #fn("6000n020A>121{370F<60:q:" #(#fn("5000n0A<60:" #()) #fn("6000n1700514D:" #(top-level-exception-handler))) reploop) newline) repl) revappend #fn("7000n2701062:" #(reverse-) revappend) reverse #fn("7000n170q062:" #(reverse-) reverse) reverse! #fn("7000n170q062:" #(reverse!-) reverse!) reverse!- #fn("8000n2I1B3B041=101?04N4?1@\x1d/40:" #() reverse!-) reverse- #fn("7000n21J400:701<0P1=62:" #(reverse-) reverse-) self-evaluating? #fn("7000n120051S;3Z040H;36040RS;JK0421051;3A040R;3:04022051Q:" #(#fn(gensym?) #fn(constant?) #fn(top-level-value)) self-evaluating?) set-syntax! #fn("8000n220710163:" #(#fn(put!) *syntax-environment*) set-syntax!) simple-sort #fn("9000n10S;J6040=S3400:0<7021850>22285>162:" #(call-with-values #fn("7000n07021A>1F=62:" #(partition #fn("6000n10AL2:" #()))) #fn("9000n22071051Ae17115163:" #(#fn(nconc) simple-sort))) simple-sort) splice-form? #fn("7000n10B;3X040<20Q;JN040<21Q;JD040<22Q;3:04730r252;J704022Q:" #(unquote-splicing unquote-nsplicing unquote length>) splice-form?) string-join #fn("9000n20J5020:215022860<5242324861>20=524258661:" #("" #fn(buffer) #fn(io-write) #fn(for-each) #fn("7000n120AF52420A062:" #(#fn(io-write))) #fn(iostream->string)) string-join) string-lpad #fn(":000n3207182122051~52062:" #(#fn(string) string-rep #fn(string-length)) string-lpad) string-map #fn("=000n2205021151EI8887L23O0422860231885251524748851?8@\f/^14258661:" #(#fn(buffer) #fn(string-length) #fn(io-putc) #fn(string-char) 1+ #fn(iostream->string)) string-map) string-rep #fn(":000n21r4L23b0701E5235021:1Kl238022061:1r2l2390220062:2200063:731513@02207401K~5262:742200521r2j262:" #(<= "" #fn(string) odd? string-rep) string-rep) string-rpad #fn(";000n32007182122051~5262:" #(#fn(string) string-rep #fn(string-length)) string-rpad) string-tail #fn("7000n2200162:" #(#fn(string-sub)) string-tail) string-trim #fn(">000n3IIb7b820872187>1_51420882288>1_5142305124087<01E895488<082895363:" #(#0# #fn("9000n48283L23P02012108252523A0A<017282518364:82:" #(#fn(string-find) #fn(string-char) 1+) trim-start) #fn(":000n3E82L23R020121072825152523?0A<0172825163:82:" #(#fn(string-find) #fn(string-char) 1-) trim-end) #fn(string-length) #fn(string-sub)) string-trim) symbol-set-doc #fn("A000z213=070021153@30q482B3H0700222374022q53825263:q:" #(putprop *doc* *funvars* #fn(append) getprop) symbol-set-doc) symbol-syntax #fn("8000n120710q63:" #(#fn(get) *syntax-environment*) symbol-syntax) table-clone #fn("9000n12050212285>1q053485:" #(#fn(table) #fn(table-foldl) #fn("8000n320A0163:" #(#fn(put!)))) table-clone) table-invert #fn("9000n12050212285>1q053485:" #(#fn(table) #fn(table-foldl) #fn("8000n320A1063:" #(#fn(put!)))) table-invert) table-keys #fn("8000n12021q063:" #(#fn(table-foldl) #fn("6000n3082P:" #())) table-keys) table-pairs #fn("8000n12021q063:" #(#fn(table-foldl) #fn("6000n301P82P:" #())) table-pairs) table-values #fn("8000n12021q063:" #(#fn(table-foldl) #fn("6000n3182P:" #())) table-values) to-proper #fn("7000n10J400:0H3600e1:0<700=51P:" #(to-proper) to-proper) top-level-exception-handler #fn("9000n17071w042285>1230>12486>1{86504:" #(*output-stream* *stderr* #fn("5000n0Aw0:" #(*output-stream*)) #fn("6000n070A51471225061:" #(print-exception print-stack-trace #fn(stacktrace))) #fn("6000n1A50420061:" #(#fn(raise)))) top-level-exception-handler) trace #fn("@000n120051718551Jg0220732425262728290e225e3e22:e12;2985e225e3e4e35152@30q^147<60:" #(#fn(top-level-value) traced? #fn(set-top-level-value!) eval λ #:g355 begin write cons quote newline apply void) trace) traced? #fn("7000n170051;3?042105121A<51d:" #(closure? #fn(function:code)) #((#fn("9000z020210P51472504230}2:" #(#fn(write) x newline #.apply))))) untrace #fn("9000n1200517185513C0220238551r3G52@30q^147460:" #(#fn(top-level-value) traced? #fn(set-top-level-value!) #fn(function:vals) void) untrace) value-get-doc #fn("8000n10<0=208551;3=0486B;350485:" #(#fn(string?)) value-get-doc) values #fn("8000z00B3:00=J500<:A0P:" #() #(#3#)) vars-to-env #fn(":000n32021182>2072230515163:" #(#fn(map) #fn("9000n2700210A52SS1FM63:" #(vinfo #fn(memq))) iota #fn(length)) vars-to-env) vector->list #fn("<000n120051qb6K852186085>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 #4# vinfo:sym #.car void #1# void? #fn("6000n10IQ:" #() void?) zero? #fn("6000n10El2:" #() zero?))1(*builtins* #(NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL #fn("5000n10<:" #()) #fn("5000n10=:" #()) NIL NIL NIL NIL #fn("5000n10B:" #()) NIL NIL NIL NIL NIL #fn("5000n10H:" #()) NIL NIL NIL #fn("8000z0700}2:" #(<)) NIL #fn("6000n201N:" #()) NIL #fn("6000n201P:" #()) #fn("6000n201Q:" #()) #fn("5000n10R:" #()) #fn("5000n10S:" #()) #fn("5000n10T:" #()) NIL #fn("5000n10V:" #()) NIL #fn("5000n10X:" #()) #fn("5000n10Y:" #()) #fn("5000n10Z:" #()) #fn("5000n10[:" #()) #fn("5000n10\\:" #()) #fn("5000n10]:" #()) NIL #fn("6000n201_:" #()) NIL NIL NIL #fn("6000n201c:" #()) #fn("6000n201d:" #()) #fn("7000z00:" #()) #fn("8000z0700}2:" #(apply)) #fn("8000z0700}2:" #(+)) #fn("8000z0700}2:" #(-)) #fn("8000z0700}2:" #(*)) #fn("8000z0700}2:" #(/)) #fn("8000z0700}2:" #(div0)) #fn("8000z0700}2:" #(=)) #fn("6000n201m:" #()) NIL #fn("8000z0700}2:" #(vector)) #fn("8000z0700}2:" #(aset!)) NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL #fn("9000n3012082>1|:" #(#fn("6000n1A061:" #()))) NIL NIL NIL NIL NIL NIL NIL NIL #fn("8000z0700}2:" #(aref)) NIL NIL NIL) *properties* #table(*funvars* #table(*prompt* (NIL) lz-unpack (T T) void? ((x)) >= ((a . rest)) rand-uint64 (T) help ((term)) length= ((lst n)) = (T) car (T) <= ((a . rest)) rand-uint32 (T) /= ((a . rest)) void (rest) lz-pack (T) rand (T) nan? (T) rand-float (T) cons? (T) vm-stats (T) * (T) rand-double (T) cdr (T) + (T) > ((a . rest))) *doc* #table(>= "Return T if the arguments are in non-increasing order (previous\none is greater than or equal to the next one)." void? "Return T if x is #<void>, NIL otherwise." length= "Bounded length test.\nUse this instead of (= (length lst) n), since it avoids unnecessary\nwork and always terminates." car "Return the first element of a list or NIL if not available." *builtins* "VM instructions as closures." <= "Return T if the arguments are in non-decreasing order (previous\none is less than or equal to the next one)." void "Return the constant #<void> while ignoring any arguments.\n#<void> is mainly used when a function has side effects but does not\nproduce any meaningful value to return, so even though T or NIL could\nbe returned instead, in case of #<void> alone, REPL will not print\nit." rand "Return a random non-negative fixnum on its maximum range." nan? "Return T if the argument is NaN, regardless of the sign." Instructions "VM instructions mapped to their encoded byte representation." rand-double "Return a random double on [0.0, 1.0] interval." > "Return T if the arguments are in strictly decreasing order (previous\none is greater than the next one)." cdr "Return the tail of a list or NIL if not available." + "Return sum of the numbers or 0 with no arguments." lz-unpack "Return decompressed data previously compressed using lz-pack.\nEither destination for the decompressed data or the expected size of\nthe decompressed data must be specified. In the latter case a new\narray is allocated." rand-uint64 "Return a random integer on [0, 2⁶⁴-1] interval." help "Display documentation for the specified term, if available." = "Return T if the arguments are equal." rand-uint32 "Return a random integer on [0, 2³²-1] interval." /= "Return T if not all arguments are equal. Shorthand for (not (= …))." lz-pack "Return data compressed using Lempel-Ziv.\nThe data must be an array, returned value will have the same type.\nThe optional level is between 0 and 10. With level 0 a simple LZSS\nusing hashing will be performed. Levels between 1 and 9 offer a\ntrade-off between time/space and ratio. Level 10 is optimal but very\nslow." rand-float "Return a random float on [0.0, 1.0] interval." arg-counts "VM instructions mapped to their expected arguments count." *prompt* "Function called by REPL to signal the user input is required.\nDefault function prints \"#;> \"." cons? "Return T if the value is a cons cell." vm-stats "Print various VM-related information, such as the number of GC calls\nso far, heap and stack size, etc." * "Return product of the numbers or 1 with no arguments." *properties* "All properties of symbols recorded with putprop are recorded in this table.")) *syntax-environment* #table(bcode:nconst #fn("7000n1200r2e3:" #(aref)) doc-for #fn("@000\x8710002000W1000J60q?140B;35040<;J40402086510B88JI087\\3?07122862353@30q@F087\\360q@<071228624534252686e2261e22688e2e4:" #(#fn(top-level-value) error "docs: " ": no funvars specified" ": funvars set but isn't a function" symbol-set-doc quote)) with-input-from #fn("<000z12021e1220e2e1e12315163:" #(#fn(nconc) with-bindings *input-stream* #fn(copy-list))) unless #fn("<000z1200q211Pe4:" #(if begin)) defmacro #fn("A000z170151863D0710<860=5341=?1@30q42223240<e22526e10=e12715153e3e2:" #(value-get-doc symbol-set-doc void set-syntax! quote #fn(nconc) λ #fn(copy-list))) time #fn("=000n1202122e1e2e123024252622e121e32728e5e3e3:" #(let #:g357 time-now prog1 princ "Elapsed time: " - " seconds" *linefeed*)) cond #fn(";000z0Ib520852185>1_51485<061:" #(#0=#fn("7000z0I:" #() void) #fn(">000n10H340q:0<85<20Q;J80485<DQ3C085=J6085<:2185=P:85=J@02285<A<0=51e3:85T23C\x94074758551513c07675855151278685<e2e12886217975855151PA<0=51e4e3:272:85<e2e1282:7585512:e2A<0=51e4e3:2885<2185=PA<0=51e4:" #(else begin or => 1arg-lambda? caddr caadr let if cddr #:g25) cond-clauses->if))) do #fn("I000z21<2071052207205220230522425268827872829e12:1=51522829e12:82512825e18:52e153e4e3e2e12825e18952e3:" #(#fn(map) car cadr #fn("6000n170051B38071061:0<:" #(cddr caddr)) letrec #:g327 λ if #fn(nconc) begin #fn(copy-list))) mark-label #fn("8000n22002122e21e4:" #(emit quote label)) with-bindings #fn("G000z12071052207205220230522425e12076888653e12720288687535129242:e12715152242:e127202;8688535152e3e164:" #(#fn(map) car cadr #fn("5000n12060:" #(#fn(gensym))) #fn(nconc) let list #fn(copy-list) #fn("7000n22001e3:" #(set!)) unwind-protect begin #fn("7000n22001e3:" #(set!)))) let #fn(">000z1q0R3B00?641<?041=?1@30q42021e12223052e124151532225052863C0268687e2e186e3@408788P:" #(#fn(nconc) λ #fn(map) #fn("5000n10B3500<:0:" #()) #fn(copy-list) #fn("5000n10B3500T:7060:" #(void)) letrec)) bcode:code #fn("7000n1200Ee3:" #(aref)) make-label #fn("5000n120e1:" #(gensym)) bcode:cenv #fn("7000n1200r3e3:" #(aref)) > #fn("<000z12021e12273151510e163:" #(#fn(nconc) < #fn(copy-list) reverse!)) when #fn(";000z1200211Pqe4:" #(if begin)) quasiquote #fn("7000n1700E62:" #(bq-process)) help #fn(";000n17002152853W072855147350424250>170026q535247350@B0722728051524735047960:" #(getprop *doc* princ newline #fn(for-each) #fn("7000n17050471A0P61:" #(newline print)) *funvars* "no help for " #fn(string) void)) bcode:ctable #fn("7000n1200Ke3:" #(aref)) with-output-to #fn("<000z12021e1220e2e1e12315163:" #(#fn(nconc) with-bindings *output-stream* #fn(copy-list))) catch #fn("?000n22012122e123242522e2262722e22829e2e3262:22e20e3e42;22e22<22e2e4e3e3:" #(trycatch λ #:g352 if and cons? eq? car quote thrown-value cadr caddr raise)) let* #fn("@000z10H3E02021e1qe12215153e1:2021e173051e1e1220=B3H02024e10=e12215153e1@301515375051e2:" #(#fn(nconc) λ #fn(copy-list) caar let* cadar)) letrec #fn(">000z1202021e12273052e122240522515154e1227605262:" #(#fn(nconc) λ #fn(map) car #fn("8000n12021e12205162:" #(#fn(nconc) set! #fn(copy-list))) #fn(copy-list) void)) /= #fn("=000z1202122e10e12315153e2:" #(not #fn(nconc) = #fn(copy-list))) bcode:sp #fn("7000n1200r4e3:" #(aref)) bcode:stack #fn(":000n2200r421220e21e3e4:" #(aset! + bcode:sp)) assert #fn(";000n1200D2122230e2e2e2e4:" #(if raise quote assert-failed)) case #fn("A000z1Ib6208621_514225023870e2e12425e126278687>215252e3:" #(#0# #fn("8000n2120C5020:1J40q:1R3=021072151e3:1H3=023072151e3:1=J>0230721<51e3:74751523=0260271e2e3:280271e2e3:" #(else eq? quote-value eqv? every symbol? memq quote memv) vals->cond) #fn(gensym) let #fn(nconc) cond #fn(map) #fn("7000n1A<F0<520=P:" #()))) receive #fn("?000z22021q1e32221e10e123825153e3:" #(call-with-values λ #fn(nconc) #fn(copy-list))) unwind-protect #fn("?000n2202122q1e3e2e1232402225e12621e12725e2e3e3e321e1e3e3:" #(let #:g353 λ prog1 trycatch #:g354 begin raise)) dotimes #fn("A000z10<0T20E2187Ke32223e186e1e12415153e4:" #(for - #fn(nconc) λ #fn(copy-list))) throw #fn("9000n220212223e201e4e2:" #(raise list quote thrown-value))) 1+ #fn("6000n10KM:" #() 1+) 1- #fn("6000n10K~:" #() 1-) 1arg-lambda? #fn("7000n10B;3E04700<51;3:04710TK62:" #(is-lambda? length=) 1arg-lambda?) <= #fn(";000z1Ib6862086>1_486<^10162:" #(#fn("7000n21S;JL041<0L2;J5040V340q:A<1<1=62:" #())) <=) > #fn(";000z1Ib6862086>1_486<^10162:" #(#fn("7000n21S;JE041<0L2;3;04A<1<1=62:" #())) >) >= #fn(";000z1Ib6862086>1_486<^10162:" #(#fn("7000n21S;JL0401<L2;J5040V340q:A<1<1=62:" #())) >=) Instructions #table(call.l 81 trycatch 75 largc 79 loadg.l 68 aref2 23 box 50 cadr 36 argc 62 setg 71 load0 21 nan? 38 vector? 45 fixnum? 41 loadc0 17 loada0 0 div0 59 keyargs 31 call 5 loada.l 69 sub2 78 add2 29 loadc.l 70 loadc 9 builtin? 43 set-car! 47 ret 10 loadi8 66 tapply 77 loadvoid 25 loada1 1 shift 46 atom? 24 cdr 13 brne.l 83 / 58 equal? 52 apply 54 dup 11 loadt 20 jmp.l 48 = 60 not 35 set-cdr! 30 eq? 33 * 57 load1 27 bound? 42 function? 44 box.l 86 < 28 brnn.l 84 jmp 16 loadv 2 for 76 lvargc 80 dummy_eof 88 + 55 brne 19 compare 61 brn 3 neg 37 number? 40 loadv.l 67 vargc 74 brbound 39 vector 63 loadc1 22 setg.l 72 cons? 18 aref 85 symbol? 34 aset! 64 car 12 cons 32 tcall.l 82 - 56 brn.l 49 optargs 87 closure 14 pop 4 eqv? 51 list 53 seta 15 seta.l 73 brnn 26 loadnil 65 loadg 7 loada 8 tcall 6) __init_globals #fn("7000n07021d37022@402384w4^147025d;350426;J50427w8429w:47;w<47=w>47?w@:" #(*os-name* "macos" #fn("6000n0702161:" #(princ "\e[0m\e[1m#;> \e[0m")) #fn("6000n0702161:" #(princ "#;> ")) *prompt* "dos" "\\" "/" *directory-separator* "\n" *linefeed* *stdout* *output-stream* *stdin* *input-stream* *stderr* *error-stream*) __init_globals) __rcscript #fn("=000n0708421c360q@T08422c37023@G08424c3=07526514q@4027^184;390428845185;3=0429857:2;53863B02<86513907=8661:q:" #(*os-name* "unknown" "plan9" "home" "macos" princ "\e]0;femtolisp v0.999\a" "HOME" #fn(os-getenv) #fn(string) *directory-separator* ".flisprc" #fn(path-exists?) load) __rcscript) __script #fn("6000n1200>121{:" #(#fn("6000n070A61:" #(load)) #fn("6000n170051421K61:" #(top-level-exception-handler #fn(exit)))) __script) __start #fn("7000n1705040=B3D00=w14qw24730T51@C00w14Dw24745047550426E61:" #(__init_globals *argv* *interactive* __script __rcscript repl #fn(exit)) __start) abs #fn("6000n10EL23500U:0:" #() abs) any #fn("7000n21B;3D0401<51;J:047001=62:" #(any) any) arg-counts #table(bound? 1 function? 1 symbol? 1 car 1 cons 2 cadr 1 nan? 1 for 3 fixnum? 1 vector? 1 cdr 1 atom? 1 div0 2 equal? 2 eqv? 2 compare 2 not 1 number? 1 set-cdr! 2 eq? 2 builtin? 1 cons? 1 set-car! 2) argc-error #fn(";000n2702102211Kl237023@402465:" #(error "compile error: " " expects " " argument." " arguments.") argc-error) array? #fn("7000n10];JF042005185B;390485<21Q:" #(#fn(typeof) array) array?) assoc #fn("7000n2701510d3501<:13:07101=62:q:" #(caar assoc) assoc) assv #fn("7000n2701510c3501<:13:07101=62:q:" #(caar assv) assv) bcode:indexfor #fn(";000n20KG0r2G20861523:02186162:2286187534870r287KMp4:" #(#fn(has?) #fn(get) #fn(put!)) bcode:indexfor) box-vars #fn("9000n2Ib68620086>2_486<^1161:" #(#fn("9000n10B3Q00<T3B070A21720<5153@30q4F<0=61:q:" #(emit box caddr))) box-vars) bq-bracket #fn(";000n20H3=070710152e2:0<22CS01El2380700=P:707324710=1K~52e3e2:0<25CT01El2390260Te2:707027710T1K~52e3e2:0<28CP01El23500T:707029710T1K~52e3e2:70710152e2:" #(list bq-process unquote cons 'unquote unquote-splicing copy-list 'unquote-splicing unquote-nsplicing 'unquote-nsplicing) bq-bracket) bq-bracket1 #fn(":000n20B3S00<20CL01El23500T:7122730=1K~52e3:730162:" #(unquote cons 'unquote bq-process) bq-bracket1) bq-process #fn("<000n20R380200e2:0]3T0717205115286<73C907486=P:757486e3:0H3400:0<26CB07327710T1KM52e3:0<28CV01El23?0790r2523500T:7:2;710=1K~52e3:7<7=052Jt07>0512?2@1>105286J807387P:87=JA07:87<7186152e3:2A7B87P7186152e162:Ib6862C186>2_486<^10q62:" #(quote bq-process vector->list list vector apply quasiquote 'quasiquote unquote length= cons 'unquote any splice-form? lastcdr #fn(map) #fn("7000n1700A62:" #(bq-bracket1)) #fn(nconc) list* #fn("=000n20J;02071151P:0B3o00<22CX020731AEl23700=@C07425e2760=AK~52e252P:F<0=770<A521P62:2071760A521P51P:" #(nconc reverse! unquote nreconc list 'unquote bq-process bq-bracket))) bq-process) builtin->instruction #fn("8000n120A0q63:" #(#fn(get)) #(#table(#.cadr cadr #.aset! aset! #.+ + #.- - #.equal? equal? #.eq? eq? #.builtin? builtin? #.not not #.cons? cons? #.cdr cdr #./ / #.div0 div0 #.set-car! set-car! #.vector vector #.set-cdr! set-cdr! #.< < #.aref aref #.for for #.cons cons #.apply apply #.eqv? eqv? #.vector? vector? #.list list #.car car #.bound? bound? #.nan? nan? #.function? function? #.symbol? symbol? #.compare compare #.fixnum? fixnum? #.atom? atom? #.= = #.number? number? #.* *))) caaaar #fn("5000n10<<<<:" #() caaaar) caaadr #fn("5000n10T<<:" #() caaadr) caaar #fn("5000n10<<<:" #() caaar) caadar #fn("5000n10<T<:" #() caadar) caaddr #fn("5000n10=T<:" #() caaddr) caadr #fn("5000n10T<:" #() caadr) caar #fn("5000n10<<:" #() caar) cadaar #fn("5000n10<<T:" #() cadaar) cadadr #fn("5000n10TT:" #() cadadr) cadar #fn("5000n10<T:" #() cadar) caddar #fn("5000n10<=T:" #() caddar) cadddr #fn("5000n10==T:" #() cadddr) caddr #4=#fn("5000n10=T:" #() caddr) call-with-values #fn("7000n205086B3@0A86<C90186=}2:18661:" #() #(#3=(*values*))) capture-var! #fn("<000n20r3G70186E5387;JG042186510r322861e152p4:" #(index-of #fn(length) #fn(nconc)) capture-var!) cdaaar #fn("5000n10<<<=:" #() cdaaar) cdaadr #fn("5000n10T<=:" #() cdaadr) cdaar #fn("5000n10<<=:" #() cdaar) cdadar #fn("5000n10<T=:" #() cdadar) cdaddr #fn("5000n10=T=:" #() cdaddr) cdadr #fn("5000n10T=:" #() cdadr) cdar #fn("5000n10<=:" #() cdar) cddaar #fn("5000n10<<==:" #() cddaar) cddadr #fn("5000n10T==:" #() cddadr) cddar #fn("5000n10<==:" #() cddar) cdddar #fn("5000n10<===:" #() cdddar) cddddr #fn("5000n10====:" #() cddddr) cdddr #fn("5000n10===:" #() cdddr) cddr #fn("5000n10==:" #() cddr) char? #fn("6000n12005121Q:" #(#fn(typeof) rune) char?) closure? #fn("6000n10\\;36040[S:" #() closure?) compile #fn("8000n170q7105162:" #(compile-f lower-define) compile) compile-and #fn("<000n570018283D218467:" #(compile-short-circuit brn) compile-and) compile-app #fn("E000n483<88R3U07088152JK088Z3E0218851[3;0218851@40887283=23523q07401q895440r40r4GKMp4750183=530r40r4G8:UMp47608237027@40288:63:89[;3904798951892:Cf07089152J\\0212:517:d3P07;83r2523E07401q83T5447602:62:89B3P07<89<513F07=83513=07>01828364:8:360q@F07401q895440r40r4GKMp4750183=530r40r4G8;UMp48:360q@=00r40r4Gr/Mp48:3C07?018283898:8;67:760823702@@402A8;63:" #(in-env? #fn(top-level-value) length> 255 compile-in compile-arglist emit tcall.l call.l builtin->instruction cadr length= is-lambda? inlineable? compile-let compile-builtin-call tcall call) compile-app) compile-arglist #fn("8000n3202101>282524228261:" #(#fn(for-each) #fn("9000n170AFq0544Ar4Ar4GKMp:" #(compile-in)) #fn(length)) compile-arglist) compile-aset! #fn("=000n3208251r2~87Kl23?07101q2282P64:K87L23h07101q2374828752P544750176828752530r40r4G88UMp47702262:7822r362:" #(#fn(length) compile-app aset! aref list-head compile-arglist list-tail emit argc-error) compile-aset!) compile-begin #fn("9000n483H3?0700182715064:83=H3>070018283<64:7001q83<5447202352474018283=64:" #(compile-in void emit pop compile-begin) compile-begin) compile-builtin-call #fn(">000n7I202186850>3?;514227385q538<3I07483=8<52J=075858<52@30q4858=26CL086El23:07702862:770858663:8=29C708;60:8=2:C708;60:8=2;C]086El23:07702<62:86r2l23:07702=62:770858663:8=2>Cm086El23:07585K62:86Kl23:07702?62:86r2l23:07702@62:770858663:8=2ACL086El23:07702B62:770858663:8=2CCL086El23:07585K62:770858663:8=2DCN086El23<07702E2F63:770858663:8=2GCX086r2L23;07585r262:770823702H@402G8663:8=2ICb086r2l23:07702J62:r286L23?07708586r3~63:7585r262:7708562:" #(#0# #fn("8000n0AEl239070FK62:7192FA63:" #(argc-error emit) num-compare) #fn(get) arg-counts length= argc-error list emit loadnil < = + load0 add2 - neg sub2 * load1 / vector loadv #() apply tapply aref aref2) compile-builtin-call) compile-f #fn("8000n2702101>22262:" #(call-with-values #fn("7000n070AF62:" #(compile-f-)) #fn("5000n20:" #())) compile-f) compile-f- #fn("O000n270501T711T517215173741T52711518;J7025@408;87H360E@802687518=268:51~73778:528:3\xa208?JL07886298>883808=U@408=54@r07:867;2<7=2<7>8?527?268?5151535152478862@8>268?51883808=U@408=5547A8608:898>55@30q42B8=L23I07886883702C@402D8=53@W0883?078862E8=53@E08:J?078862F8=53@30q47G0897H7I1518952537J868@<52486r4268951r4Mp47K868@D7I15154478862L5247M2N7O86EG517P86518<5386r3G62:" #(make-code-emitter lastcdr lambda:vars filter cons? λ #fn(length) keyword-arg? emit optargs bcode:indexfor make-perfect-hash-table #fn(map) cons car iota keyargs emit-optional-arg-inits 255 lvargc largc vargc argc extend-env complex-bindings lambda:body box-vars compile-in ret values #fn(function) encode-byte-code const-to-idx-vec) compile-f-) compile-if #fn("A000n420502050205083T718351728351B3;0738351@30q8;DC=07401828<64:8;J=07401828=64:7401q8;89554750268953475027885347401828<544823<07502852@;0750298:53475027895347401828=544750278:63:" #(#fn(gensym) caddr cdddr cadddr compile-in emit brn label ret jmp) compile-if) compile-in #fn("B000\x8740005000W4000J60q?4483R3<0700183D64:83H3\x97083EC:07102262:83KC:07102362:83DC:07102462:83J:07102562:7683513:07102762:7883513<0710298363:7102:8363:83<2;C<07<0183=63:83<RS;JD0483<Z;J;047=83<1523=07>01828364:83<892?CS07@83T513>07A018283T64:7102:83T63:892BC=07C01828364:892DC>07E018283=64:892FC;07G018363:892HCD07I2J183>22K01>262:892LC@07M018283=8465:892NC>07O018283=64:892PCE07Q0183T2D7R8351P64:892SCE07A01D83T5447102T62:892UC\x93083T7R83517V8;518:R360q@807W2X5148<3`08;=?;47Y8:8<8;<B;3G047Z8;<<51;3:047[8;<5153@30q47\\018:8;<64:892]Cp07A01q2Hq83Te35447^7_835151360q@807W2`5147A01q7_83515447102]62:7>01828364:" #(compile-sym emit load0 load1 loadt loadnil void? loadvoid fits-i8 loadi8 loadv aset! compile-aset! in-env? compile-app quote self-evaluating? compile-in if compile-if begin compile-begin prog1 compile-prog1 λ call-with-values #fn("7000n070AF62:" #(compile-f-)) #fn("9000n270A21053413K02223AF>2152470A242515163:q:" #(emit loadv #fn(for-each) #fn("9000n170AF0q64:" #(compile-sym)) closure #fn(length))) and compile-and or compile-or while compile-while cddr return ret set! value-get-doc error "set!: name must be a symbol" symbol-set-doc is-lambda? lambda:vars compile-set! trycatch 1arg-lambda? caddr "trycatch: second form must be a 1-argument lambda") compile-in) compile-let #fn("A000n483<83=0r4G88T70018953718;727388518;528:537408=524258=1<521=P7608>827388515440r40r4G8<UMp4E8<L23A082J<0770288<63:q:" #(compile-arglist vars-to-env complex-bindings caddr box-vars #fn(nconc) compile-in emit shift) compile-let) compile-or #fn("<000n470018283q21q67:" #(compile-short-circuit brnn) compile-or) compile-prog1 #fn(":000n37001q82T544718251B3_00r40r4GKMp47201q718251544730245240r40r4Gr/Mp:q:" #(compile-in cddr compile-begin emit pop) compile-prog1) compile-set! #fn("?000n470821E538821CF07201q83544730248263:88<El288=T893<07588=51@9076082528:3o07308937027@40288;5340r40r4GKMp47201q835440r40r4Gr/Mp47302962:7201q8354489JA07:2;2<825251@30q47302=8;63:" #(lookup-sym global compile-in emit setg vinfo:index capture-var! loada loadc set-car! error #fn(string) "internal error: misallocated var " seta) compile-set!) compile-short-circuit #fn("?000n783H3?0700182848665:83=H3@070018283<8665:86;J70421507001q83<865540r40r4GKMp486360q@9072023524720858;5340r40r4Gr/Mp486360q@907202452475018283=84858657486340q:720268;63:" #(compile-in #fn(gensym) emit dup pop compile-short-circuit label) compile-short-circuit) compile-sym #fn(";000n470821E538821C`02282513M073248251513@07502624825163:750278263:88<El23W0750287988=51534833A088=T3:07502:62:q:7502;7<08252534833A088=T3:07502:62:q:" #(lookup-sym global #fn(constant?) printable? #fn(top-level-value) emit loadv loadg loada vinfo:index car loadc capture-var!) compile-sym) compile-thunk #fn(":000n170q21q72051e362:" #(compile-f λ lower-define) compile-thunk) compile-while #fn(";000n4205020507101q72505440r40r4GKMp473024885347101q825447302589534730265240r40r4Gr/Mp47101q835447302788534730248963:" #(#fn(gensym) compile-in void emit label brn pop jmp) compile-while) complex-bindings #fn("=000n2205020507101qq8687564722386>174875162:" #(#fn(table) complex-bindings- filter #fn("7000n120A062:" #(#fn(has?))) table-keys) complex-bindings) complex-bindings- #fn("=000n61J40q:0R3K0833D02001523;021840D63:q:0H;J80472051340q:0<23Co0200T1523Q021850TD534833>021840TD53@30q@30q474750511q83848566:760<513U074770517817905152q82S;J50483848566:740<17:051838485562;2<1838485>40=52P:" #(#fn(memq) #fn(put!) quoted? set! complex-bindings- caddr is-lambda? lambda:body diff lambda:vars inlineable? #fn(map) #fn(";000n1700AqF929366:" #(complex-bindings-))) complex-bindings-) const-to-idx-vec #fn("9000n1200r2G51212285>10KG52485:" #(#fn(vector-alloc) #fn(for-each) #fn("7000n2A10p:" #())) const-to-idx-vec) copy-tree #fn("7000n10H3400:700<51700=51P:" #(copy-tree) copy-tree) count #fn("9000n2Ib620862186>1_51486<01E63:" #(#0# #fn("9000n31J5082:A<01=01<5139082KM@408263:" #() count-)) count) delete-duplicates #fn(":000n1700rD523O02150Ib686228586>2_486<^10q62:0H3400:0<0=73858652390748661:85748651P:" #(length> #fn(table) #fn("8000n20H38070161:21A0<523:0F<0=162:22A0<D534F<0=0<1P62:" #(reverse! #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("U000\x871000.///W1000J60q?14z282JG07001E534715047260:@30q482<2305124051II252687>1?:5142527187>2?;514r4288851b<I8<<8=L23\x9124292:888<>2q7;53r48<<L23907150@30q4E87K~2<|48<8<<KM_48>2=8?2>523[08;8>8<<r45348:897?888<<52G5148<8<<r4M_@\x1f12=8?2@523V08;8>8<<K5348:89888<<GG5148<8<<KM_@\xf012=8?2A523e08;8>8<<K5347B2C888<<G8>2DC70r3@30EM515148<8<<KM_@\xb212=8?2E523\\08;8>8<<r45347B2C7?888<<52515148<8<<r4M_@}12=8?2F523\xb808;8>8<<r88>2GC70r4@30EM5347B2C7?888<<52512H5248<8<<r4M_47B2C7?888<<52515148<8<<r4M_48>2GCY07B2H5147B2C7?888<<52512H5248<8<<r4M_@30q@\xec08?2Ic3^08;8>8<<r45347B2C7?888<<52512H5248<8<<r4M_@\xb802=8?2J523e08;8>8<<r25347B2K7L8<<r,7M888<<52g3515248<8<<r2M_@z02=8?2N523e08;8>8<<r45347B2K7L8<<r,7?888<<52g3515248<8<<r4M_@<08;8>8<<E53^1^1@\xc9-:" #(disassemble newline void #fn(function:code) #fn(function:vals) #1=#fn("7000z0I:" #() void) #fn("9000n10\\3F00[JA070504710qAKM63:72061:" #(newline disassemble print) print-val) #fn(";000n370A3U0FEl23N071A72151523A0A182ML237023@4024751r5~512602765:" #(princ >= 1- " >" " " hex5 ": " " ") print-inst) #fn(length) #fn(table-foldl) #fn("7000n382;J?041AF<GQ;34040:" #()) 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 aref) princ #fn(number->string) aref (loada.l seta.l loadc.l largc lvargc call.l tcall.l box.l) (optargs keyargs) keyargs " " brbound (jmp brne brnn brn) "@" hex5 ref-int16-LE (jmp.l brne.l brnn.l brn.l)) disassemble) div #fn("7000n201k0EL2;3D041EL2;3404K;J504r/;J404EM:" #() div) emit #fn("N000z2I2021?75140EG82Jk0122CB088<23C:08824_@R0125CE08788<513;00E88=p@900E188Pp@D126127523A078082<52e1?2@30q42912:52893D02;82<L23:089T?1@30q^142912<52893D02;82<L23:089T?1@30q^1412=C\\0822>d3=02??14q?2@F0822@d3=02A?14q?2@30q@30q412BC\\0822>d3=02C?14q?2@F0822@d3=02D?14q?2@30q@30q488<12EQ;3b04892FCB00E82<2G88=PPp@J0892HCB00E82<2I88=PPp@30q;J@040E7J182P8852p^140:" #(#0# #fn("7000n17002162:" #(member (load0 load1 loadt loadf loadnil loadvoid)) load?) car cdr cadr pop #fn(memq) (loadv loadg setg) bcode:indexfor #fn(assq) ((loadv loadv.l) (loadg loadg.l) (setg setg.l) (loada loada.l) (seta seta.l) (box box.l)) 255 ((loadc loadc.l)) loada (0) loada0 (1) loada1 loadc loadc0 loadc1 brn not brnn eq? brne nreconc) emit) emit-optional-arg-inits #fn("<000n582B3\x91020507102284534710238953474075176838452q53q7782515447102884534710295247102:895347;0182=8384KM65:q:" #(#fn(gensym) emit brbound brnn compile-in extend-env list-head cadar seta pop label emit-optional-arg-inits) emit-optional-arg-inits) encode-byte-code #fn("P000n17005171855172238651r3238651r2ki2M2452238651E255025502650qq278<28524I8988L23\xc0148689G?=48=29CP02:8:8689KMG2;8<5153489r2M?9@\x8f1278<2<2=7>873k08=8D2?C702@@X08D2AC702B@L08D2CC702D@@08D2EC702F@408=^1@408=525152489KM?948988L2;38048689G?>42G8=2H523`02:8;2;8<518>534278<873707I@407JE5152489KM?9@\xeb08=2KCH0278<2L8>5152489KM?9@\xce08>X3\xc708=2G8?2M523H0278<2L8>5152489KM?9@\x9f02G8?2N523\x810278<2L8>5152489KM?94278<2L8689G5152489KM?948=2OCK0278<2L8689G5152489KM?9@30q@E0278<2P8>5152489KM?9^1@30q@\x9b.42Q2R8<878:>38;5242S8<61:" #(reverse! list->vector >= #fn(length) 65536 #fn(table) #fn(buffer) #fn(io-write) #int32(0) label #fn(put!) #fn(sizeof) #fn(byte) #fn(get) Instructions jmp jmp.l brne brne.l brnn brnn.l brn brn.l #fn(memq) (jmp brne brnn brn) int32 int16 brbound #fn(int32) (loadv.l loadg.l setg.l loada.l seta.l largc lvargc call.l tcall.l loadc.l box.l) (optargs keyargs) keyargs #fn(uint8) #fn(for-each) #fn(";000n220A052421AF37072@407324921520~5162:" #(#fn(io-seek) #fn(io-write) int32 int16 #fn(get))) #fn(iostream->string)) encode-byte-code) error #fn("9000z020210P61:" #(#fn(raise) error) error) eval #fn("7000n170710515160:" #(compile-thunk expand) eval) even? #fn("7000n1200K52El2:" #(#fn(logand)) even?) every #fn("7000n21H;JD0401<51;3:047001=62:" #(every) every) expand #fn("G000n1IIIIIIIIIIIb5b6b7b8b9b:b;b<b=b>b?208521_51420862286>1_514208723e1_51420882485868?87>4_5142089258?89>2_514208:268:>1_514208;278:8988>3_514208<288?8:8988>4_514208=29888?>2_514208>2:_514208?2;8?8>8;8<8=>5_5148?<0q62:" #(#0# #fn("7000n20Z;J904200152S:" #(#fn(assq)) top?) #fn("8000n10H3400:020d3400:0<B3P07105122CF023A<7405151A<0=5162:0<A<0=51P:" #(((begin)) caar begin #fn(append) cdar) splice-begin) *expanded* #fn("A000n20H3400:A<201523:0F<051@300A<21152873;0728651@30q2324758852152b987JA024269289>28662:Ib:8:278:928993>4_48:<^186518:I8;B3c0493<788;51QJC08;92<8;<89<52_@;08;798;51_48;=?;@\xfb/48::" #(begin def get-defined-vars #fn(nconc) #fn(map) list #fn("7000n1A<0F<62:" #()) #fn(";000n10H3400:0<B3F02071051C<00<A<0=51P:F<0<92<52922223747585515292<52_493<85PA<0=51P:" #(def caar #fn(nconc) #fn(map) list get-defined-vars)) caar cdar) expand-body) #fn("9000n20H3400:0<B3M00<=B3F070051A<71051152e2@400<F<0=152P:" #(caar cadar) expand-lambda-list) #fn("7000n10H3600e1:0<B3?070051A<0=51P:0<A<0=51P:" #(caar) l-vars) #fn("?000n20T7005171051A<0T5122237489521522225e1F<868:52e192<888:528764:" #(lastcdr cddr #fn(nconc) #fn(map) list λ) expand-lambda) #fn("D000n20=S;J6040TH3o070051J400:0T717005151873B00=?0472868752@30q42386A<74051152e3:750517605170051718851F<86512728798:52152893E088=?847287898653@30q42723e18792<868;52Pe193<888;5263:" #(cddr value-get-doc symbol-set-doc def caddr cdadr caadr #fn(nconc) #fn(map) list) expand-define) #fn("=000n20T20A<71051222324F1>2865215252P:" #(begin cddr #fn(nconc) #fn(map) #fn("9000n10<70A<0TF525150Fe3:" #(compile-thunk))) expand-let-syntax) #fn("5000n20:" #() local-expansion-env) #fn("<000n20H3400:0<208615221A10>3873P087=B3I0A<87T0=f2F<72875115262:73051893>0A<890=f2162:87;J?0486RS;J60486Z3708860:8624C400:8625C:092<0162:8625C:092<0162:8626C:093<0162:8627C:094<0162:8860:" #(#fn(assq) #fn(":000n0Ib48420AF84>3_484<^19261:" #(#fn("8000n10H3400:0<H3700<@90A<0<F5292<0=51P:" #()))) caddr macrocall? quote λ def let-syntax) expand-in)) expand) expand-define #fn("@000n10T70051B3:070051@H085R37021@=07223740515285R3@021258586<e3e2:212585<2627e185=e128865185<54e3e2:" #(cddr #1# error "compile error: invalid syntax " print-to-string set! #fn(nconc) λ #fn(copy-list)) expand-define) extend-env #fn("8000n370182E530P:" #(vars-to-env) extend-env) filter #fn("9000n2I20210>1?65148601qe163:" #(#0# #fn("8000n382I1B3Q04A1<513?0821<qPN=?2@30q41=?1@\x0e/4=:" #() filter-)) filter) fits-i8 #fn("8000n10Y;3<0470r\xaf0r\xb063:" #(>=) fits-i8) foldl #fn("9000n382J401:700082<15282=63:" #(foldl) foldl) foldr #fn(":000n382J401:082<700182=5362:" #(foldr) foldr) get-defined-vars #fn("7000n170A<05161:" #(delete-duplicates) #(#2=(#fn("8000n10H340q:0<20Cj00=B3d00TR;37040Te1;JS040TB;3E0471051R;3:0471051e1;J404q:0<22C?07324A<0=52}2:q:" #(def caadr begin nconc #fn(map)) #(#2#))))) getprop #fn(":000\x8720003000W2000J60q?2420711q5387;3<04208708253;J50482:" #(#fn(get) *properties*) getprop) hex5 #fn("8000n170210r@52r52263:" #(string-lpad #fn(number->string) #\0) hex5) identity #fn("5000n10:" #() identity) in-env? #fn("7000n21B;3F042001<52;J:047101=62:" #(#fn(assq) in-env?) in-env?) index-of #fn("9000n31J40q:01<C5082:7001=82KM63:" #(index-of) index-of) inlineable? #fn("9000n10<85B;3u047085<51;3i047185T51;3]04727385T52;3O047485T2552S;3@047685T270=5162:" #(is-lambda? list? every symbol? length> 255 length= #fn(length)) inlineable?) io-readall #fn("8000n1205021850524228561:" #(#fn(buffer) #fn(io-copy) #fn(iostream->string)) io-readall) io-readline #fn("7000n12002162:" #(#fn(io-readuntil) #\newline) io-readline) io-readlines #fn("7000n17071062:" #(read-all-of io-readline) io-readlines) iota #fn("7000n17071062:" #(map-int identity) iota) is-lambda? #fn("6000n1020Q;J704020Q:" #(λ) is-lambda?) keyword->symbol #fn(";000n1200513K021220512386K24865153^161:0:" #(#fn(keyword?) #fn(symbol) #fn(string) #fn(string-sub) #fn(string-length)) keyword->symbol) keyword-arg? #fn("6000n10B;3904200<61:" #(#fn(keyword?)) keyword-arg?) lambda-vars #fn(":000n1Ib520852185>1_51485<00qq54422237405162:" #(#0# #fn(":000n40S;J5040R340D:0B3Z00<R3T082;J504833<0702112263:A<0=1828364:0B3\x8d00<B3\x870730<r2523?074051R360q@=070250<2615442774051513=0A<0=182D64:833<0702112863:A<0=1D8364:0B3>070290<26164:01C:07021162:7029026164:" #(error "compile error: invalid argument list " ": optional arguments must come after required." length= caar "compile error: invalid optional argument " " in list " #fn(keyword?) ": keyword arguments must come last." "compile error: invalid formal argument ") check-formals) #fn(map) #fn("6000n10B390700<61:0:" #(keyword->symbol)) to-proper) lambda-vars) lambda:body #fn("6000n170061:" #(caddr) lambda:body) lambda:vars #fn("6000n1700T61:" #(lambda-vars) lambda:vars) last-pair #fn("6000n10=H3400:700=61:" #(last-pair) last-pair) lastcdr #fn("6000n10H3400:70051=:" #(last-pair) lastcdr) length= #fn("8000n21EL2340q:1El23500H:0H3701El2:700=1K~62:" #(length=) length=) length> #fn("8000n21EL23400:1El23;00B;34040:0H3701EL2:700=1K~62:" #(length>) length>) list->vector #fn("6000n1700}2:" #(vector) list->vector) list-head #fn("9000n2701E52340q:0<710=1K~52P:" #(<= list-head) list-head) list-ref #fn("7000n2700152<:" #(list-tail) list-ref) list-tail #fn("8000n2701E523400:710=1K~62:" #(<= list-tail) list-tail) list? #fn("6000n10S;J@040B;3904700=61:" #(list?) list?) load #fn("9000n120021522285>123850>2{:" #(#fn(file) :read #fn("9000n0Ib48420A84>2_484<^1III63:" #(#fn("9000n320A51JG0F<21A510721514735063:24A514737215161:" #(#fn(io-eof?) #fn(read) load-process void #fn(io-close))))) #fn("8000n120A5142122F0e361:" #(#fn(io-close) #fn(raise) load-error))) load) load-process #fn("6000n170061:" #(eval) load-process) lookup-sym #fn(";000n31J5020:1<2108752883808288P:7201=82KM63:" #(global #fn(assq) lookup-sym) lookup-sym) lower-define #fn(";000n1I2021?55140H;J804720513400:0<23C<0747505161:760<513K02728e10Te185051e17905164:2:74062:" #(#1# #fn("=000n170051B3N071051B3=02270051P@7073051@607450758551768551863D0278687e328748652P:87:" #(cddr cdddr begin caddr void get-defined-vars lower-define λ #fn(map)) λ-body) quoted? def lower-define expand-define is-lambda? #fn(nconc) λ lastcdr #fn(map)) lower-define) macrocall? #fn("6000n10<R;3904700<61:" #(symbol-syntax) macrocall?) macroexpand-1 #fn("7000n10H3400:7005185390850=}2:0:" #(macrocall?) macroexpand-1) make-code-emitter #fn("9000n0q2050EqEo5:" #(#fn(table)) make-code-emitter) make-perfect-hash-table #fn(";000n1Ib5208521_514Ib6862285860>3_486<^12305161:" #(#1# #fn("8000n270712205151162:" #(mod0 abs #fn(hash)) $hash-keyword) #fn("=000n120r20i2q52Ib68621A085F86>5_486<^19261:" #(#fn(vector-alloc) #fn(":000n10B3p070051r2A<85F52i29286G3;093<FKM61:928685p49286KM71051p494<0=61:92:" #(caar cdar)))) #fn(length)) make-perfect-hash-table) make-system-image #fn("@000n120021222354202402552212223542650277879qw84Dw942:898:>22;88878586>42<8;>1{8;504:" #(#fn(file) :write :create :truncate #fn(string) ".builtin" #fn(buffer) (*linefeed* *directory-separator* *argv* that *print-pretty* *print-width* *print-readably* *print-level* *print-length* *os-name* *interactive* *prompt* *os-version* procedure? top-level-bound?) *print-pretty* *print-readably* #fn("5000n0Aw04Fw1:" #(*print-pretty* *print-readably*)) #fn("?000n07021A>17223505152742576842577845253f22885F52428859252429927:52^1^142;F512<2=F51r:522>2?E2@2A84522B84r(522B84r 522B84r\x18525629938652429938552^1^1^142C925142C9361:" #(filter #fn("8000n10Z;3u0420051S;3j0421051[S;JC0422051222105151dS;3I04230A52S;3=04242105151S:" #(#fn(constant?) #fn(top-level-value) #fn(string) #fn(memq) #fn(iostream?))) simple-sort #fn(environment) nconc #fn(map) list top-level-value #fn(write) #fn(io-write) *linefeed* #fn(sizeof) #fn(lz-pack) #fn(iostream->string) #fn(array) byte #fn(logand) 255 #fn(ash) #fn(io-close))) #fn("6000n1A50420061:" #(#fn(raise)))) make-system-image) map! #fn("8000n21I1B3B04101<51_41=?1@\x1d/4:" #() map!) map-int #fn(";000n2701E52340q:0E51qPqb78786_4K7115122870>2|486:" #(<= 1- #fn("7000n1A<F051qPN4AA<=_:" #())) map-int) max #fn(";000z11J400:70210163:" #(foldl #fn("6000n201L23401:0:" #())) max) member #fn("7000n21<0d3401:13:07001=62:q:" #(member) member) memv #fn("7000n21<0c3401:13:07001=62:q:" #(memv) memv) min #fn(";000z11J400:70210163:" #(foldl #fn("6000n201L23400:1:" #())) min) mod #fn("8000n207001521i2~:" #(div) mod) mod0 #fn("7000n2001k1i2~:" #() mod0) negative? #fn("6000n10EL2:" #() negative?) nestlist #fn(":000n37082E52340q:1710015182K~53P:" #(<= nestlist) nestlist) newline #fn("8000\x8700001000W0000J7070?04210725247360:" #(*output-stream* #fn(io-write) *linefeed* void) newline) nreconc #fn("7000n2701062:" #(reverse!-) nreconc) odd? #fn("6000n170051S:" #(even?) odd?) partition #fn(":000n2I2021?65148601qe1qe164:" #(#0# #fn("9000n48283PI1B3Z0401<513?0821<qPN=?2@<0831<qPN=?341=?1@\x05/47088<=88==62:" #(values) partition-)) partition) positive? #fn("6000n1E0L2:" #() positive?) princ #fn(";000z070qw042185>1220>12386>1{86504:" #(*print-readably* #fn("5000n0Aw0:" #(*print-readably*)) #fn("7000n02071A62:" #(#fn(for-each) write)) #fn("6000n1A50420061:" #(#fn(raise)))) princ) print #fn("9000z02071062:" #(#fn(for-each) write) print) print-exception #fn("=000n10B3e00<20C^0710r3523T072230T2425760515127554787605151@\x0e00B3Z00<29CS0710r3523I0722:760512;534780T51@\xe100B3P00<2<CI0710r2523?0722=0T2>53@\xbe00B3I00<2?CB0722@514720=f2@\xa200B3N00<2ACG07B76051514722C0T52@\x8107D0513m0710r2523c0780<51472275140T2E8551;J60485R37072@40788551^1@>0722F514780514727G61:" #(type-error length= princ "type error: expected " ", got " #fn(typeof) caddr ": " print 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("@000n1IIb5b620852185>1_51420862285>1_51473740r3523F075076370r5@40r452@300517778292:2;505252Eb92<2=868889>38762:" #(#0# #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:q:" #(closure?))) find-in-f) #fn(":000n220A01>321{863E0722374758651522662:27:" #(#fn("8000n02021AF>292524q:" #(#fn(for-each) #fn("8000n1A<0Fq63:" #()))) #fn("6000n10B3F00<20C?00T21C8072061:23061:" #(thrown-value ffound caddr #fn(raise))) string-join #fn(map) string reverse! "/" "λ") fn-name) reverse! length> list-tail *interactive* filter closure? #fn(map) #fn("6000n10Z;380420061:" #(#fn(top-level-value))) #fn(environment) #fn(for-each) #fn("9000n17021A<0KGF52524222374051==52470257652492<El23?0770KG0EG52@30q49292<KM_:" #(princ "(" #fn(for-each) #fn("6000n1702151472061:" #(princ " " print)) vector->list ")" *linefeed* disassemble))) print-stack-trace) print-to-string #fn("8000n1205021085524228561:" #(#fn(buffer) #fn(write) #fn(iostream->string)) print-to-string) printable? #fn("6000n120051;JB0471051;J80422051S:" #(#fn(iostream?) void? #fn(eof-object?)) printable?) putprop #fn(";000n320711q5387360q@F02250237118853488?7^14238708253482:" #(#fn(get) *properties* #fn(table) #fn(put!)) putprop) quote-value #fn("6000n1700513400:210e2:" #(self-evaluating? quote) quote-value) quoted? #fn("6000n10<20Q:" #(quote) quoted?) random #fn("7000n1200513<0712250062:23500i2:" #(#fn(integer?) mod #fn(rand) #fn(rand-double)) random) read-all #fn("7000n17071062:" #(read-all-of read) read-all) read-all-of #fn(":000n2Ib686201860>3_486<^1q015162:" #(#fn("8000n220A5138071061:F<10P92A5162:" #(#fn(io-eof?) reverse!))) read-all-of) ref-int16-LE #fn(":000n2202101EMGE522101KMGr852M61:" #(#fn(int16) #fn(ash)) ref-int16-LE) ref-int32-LE #fn("<000n2202101EMGE522101KMGr8522101r2MGr@522101r3MGrH52g461:" #(#fn(int32) #fn(ash)) ref-int32-LE) remprop #fn("8000n220711q5386;3F042286052;3:042386062:" #(#fn(get) *properties* #fn(has?) #fn(del!)) remprop) repl #fn(";000n0IIb4b5208421_5142085228485>2_51485<5047360:" #(#0# #fn("9000n07050421725142324{257651S;3Z04778451788551360q@=079855147:5047;85w<61:" #(*prompt* #fn(io-flush) *output-stream* #fn("5000n02060:" #(#fn(read))) #fn("6000n1207151422061:" #(#fn(io-discardbuffer) *input-stream* #fn(raise))) #fn(io-eof?) *input-stream* load-process void? print newline void that) prompt) #fn("6000n020A>121{370F<60:q:" #(#fn("5000n0A<60:" #()) #fn("6000n1700514D:" #(top-level-exception-handler))) reploop) newline) repl) revappend #fn("7000n2701062:" #(reverse-) revappend) reverse #fn("7000n170q062:" #(reverse-) reverse) reverse! #fn("7000n170q062:" #(reverse!-) reverse!) reverse!- #fn("8000n2I1B3B041=101?04N4?1@\x1d/40:" #() reverse!-) reverse- #fn("7000n21J400:701<0P1=62:" #(reverse-) reverse-) self-evaluating? #fn("7000n120051S;3Z040H;36040RS;JK0421051;3A040R;3:04022051Q:" #(#fn(gensym?) #fn(constant?) #fn(top-level-value)) self-evaluating?) set-syntax! #fn("8000n220710163:" #(#fn(put!) *syntax-environment*) set-syntax!) simple-sort #fn("9000n10S;J6040=S3400:0<7021850>22285>162:" #(call-with-values #fn("7000n07021A>1F=62:" #(partition #fn("6000n10AL2:" #()))) #fn("9000n22071051Ae17115163:" #(#fn(nconc) simple-sort))) simple-sort) splice-form? #fn("7000n10B;3X040<20Q;JN040<21Q;JD040<22Q;3:04730r252;J704022Q:" #(unquote-splicing unquote-nsplicing unquote length>) splice-form?) string-join #fn("9000n20J5020:215022860<5242324861>20=524258661:" #("" #fn(buffer) #fn(io-write) #fn(for-each) #fn("7000n120AF52420A062:" #(#fn(io-write))) #fn(iostream->string)) string-join) string-lpad #fn(":000n3207182122051~52062:" #(#fn(string) string-rep #fn(string-length)) string-lpad) string-map #fn("=000n2205021151EI8887L23O0422860231885251524748851?8@\f/^14258661:" #(#fn(buffer) #fn(string-length) #fn(io-putc) #fn(string-char) 1+ #fn(iostream->string)) string-map) string-rep #fn(":000n21r4L23b0701E5235021:1Kl238022061:1r2l2390220062:2200063:731513@02207401K~5262:742200521r2j262:" #(<= "" #fn(string) odd? string-rep) string-rep) string-rpad #fn(";000n32007182122051~5262:" #(#fn(string) string-rep #fn(string-length)) string-rpad) string-tail #fn("7000n2200162:" #(#fn(string-sub)) string-tail) string-trim #fn(">000n3IIb7b820872187>1_51420882288>1_5142305124087<01E895488<082895363:" #(#0# #fn("9000n48283L23P02012108252523A0A<017282518364:82:" #(#fn(string-find) #fn(string-char) 1+) trim-start) #fn(":000n3E82L23R020121072825152523?0A<0172825163:82:" #(#fn(string-find) #fn(string-char) 1-) trim-end) #fn(string-length) #fn(string-sub)) string-trim) symbol-set-doc #fn("A000z213=070021153@30q482B3H0700222374022q53825263:q:" #(putprop *doc* *funvars* #fn(append) getprop) symbol-set-doc) symbol-syntax #fn("8000n120710q63:" #(#fn(get) *syntax-environment*) symbol-syntax) table-clone #fn("9000n12050212285>1q053485:" #(#fn(table) #fn(table-foldl) #fn("8000n320A0163:" #(#fn(put!)))) table-clone) table-invert #fn("9000n12050212285>1q053485:" #(#fn(table) #fn(table-foldl) #fn("8000n320A1063:" #(#fn(put!)))) table-invert) table-keys #fn("8000n12021q063:" #(#fn(table-foldl) #fn("6000n3082P:" #())) table-keys) table-pairs #fn("8000n12021q063:" #(#fn(table-foldl) #fn("6000n301P82P:" #())) table-pairs) table-values #fn("8000n12021q063:" #(#fn(table-foldl) #fn("6000n3182P:" #())) table-values) to-proper #fn("7000n10J400:0H3600e1:0<700=51P:" #(to-proper) to-proper) top-level-exception-handler #fn("9000n17071w042285>1230>12486>1{86504:" #(*output-stream* *stderr* #fn("5000n0Aw0:" #(*output-stream*)) #fn("6000n070A51471225061:" #(print-exception print-stack-trace #fn(stacktrace))) #fn("6000n1A50420061:" #(#fn(raise)))) top-level-exception-handler) trace #fn("@000n120051718551Jg0220732425262728290e225e3e22:e12;2985e225e3e4e35152@30q^147<60:" #(#fn(top-level-value) traced? #fn(set-top-level-value!) eval λ #:g355 begin write cons quote newline apply void) trace) traced? #fn("7000n170051;3?042105121A<51d:" #(closure? #fn(function:code)) #((#fn("9000z020210P51472504230}2:" #(#fn(write) x newline #.apply))))) untrace #fn("9000n1200517185513C0220238551r3G52@30q^147460:" #(#fn(top-level-value) traced? #fn(set-top-level-value!) #fn(function:vals) void) untrace) value-get-doc #fn("8000n10<0=208551;3=0486B;350485:" #(#fn(string?)) value-get-doc) values #fn("8000z00B3:00=J500<:A0P:" #() #(#3#)) vars-to-env #fn(":000n32021182>2072230515163:" #(#fn(map) #fn("9000n2700210A52SS1FM63:" #(vinfo #fn(memq))) iota #fn(length)) vars-to-env) vector->list #fn("<000n120051qb6K852186085>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 #4# vinfo:sym #.car void #1# void? #fn("6000n10IQ:" #() void?) zero? #fn("6000n10El2:" #() zero?))
boot/flisp.boot.builtin+0−0

Binary file not shown.

src/compiler.lsp+14−16
@@ -1,5 +1,3 @@
1; -*- scheme -*-
2
3;; code generation state, constant tables, bytecode encoding1;; code generation state, constant tables, bytecode encoding
4 2
5(def (make-code-emitter) (vector () (table) 0 () 0))3(def (make-code-emitter) (vector () (table) 0 () 0))
@@ -265,9 +263,9 @@ · 259 unmodified lines
265 (else (if (cons? (cdddr x))263 (else (if (cons? (cdddr x))
266 (cadddr x)264 (cadddr x)
267 nil)))265 nil)))
268 (cond ((eq? test #t)266 (cond ((eq? test t)
269 (compile-in g env tail? then))267 (compile-in g env tail? then))
270 ((eq? test nil)268 ((not test)
271 (compile-in g env tail? else))269 (compile-in g env tail? else))
272 (else270 (else
273 (compile-in g env nil test elsel)271 (compile-in g env nil test elsel)
@@ -336,7 +334,7 @@ · 62 unmodified lines
336 (unless outl (mark-label g end))))))334 (unless outl (mark-label g end))))))
337 335
338(def (compile-and g env tail? forms outl)336(def (compile-and g env tail? forms outl)
339 (compile-short-circuit g env tail? forms #t 'brn outl))337 (compile-short-circuit g env tail? forms t 'brn outl))
340(def (compile-or g env tail? forms)338(def (compile-or g env tail? forms)
341 (compile-short-circuit g env tail? forms nil 'brnn nil))339 (compile-short-circuit g env tail? forms nil 'brnn nil))
342 340
@@ -482,12 +480,12 @@ · 139 unmodified lines
482(def (fits-i8 x) (and (fixnum? x) (>= 127 x -128)))480(def (fits-i8 x) (and (fixnum? x) (>= 127 x -128)))
483 481
484(def (compile-in g env tail? x (outl nil))482(def (compile-in g env tail? x (outl nil))
485 (cond ((symbol? x) (compile-sym g env x #t))483 (cond ((symbol? x) (compile-sym g env x t))
486 ((atom? x)484 ((atom? x)
487 (cond ((eq? x 0) (emit g 'load0))485 (cond ((eq? x 0) (emit g 'load0))
488 ((eq? x 1) (emit g 'load1))486 ((eq? x 1) (emit g 'load1))
489 ((eq? x #t) (emit g 'loadt))487 ((eq? x t) (emit g 'loadt))
490 ((eq? x nil) (emit g 'loadnil))488 ((not x) (emit g 'loadnil))
491 ((void? x) (emit g 'loadvoid))489 ((void? x) (emit g 'loadvoid))
492 ((fits-i8 x) (emit g 'loadi8 x))490 ((fits-i8 x) (emit g 'loadi8 x))
493 (else (emit g 'loadv x))))491 (else (emit g 'loadv x))))
@@ -514,7 +512,7 @@ · 20 unmodified lines
514 (and (compile-and g env tail? (cdr x) outl))512 (and (compile-and g env tail? (cdr x) outl))
515 (or (compile-or g env tail? (cdr x)))513 (or (compile-or g env tail? (cdr x)))
516 (while (compile-while g env (cadr x) (cons 'begin (cddr x))))514 (while (compile-while g env (cadr x) (cons 'begin (cddr x))))
517 (return (compile-in g env #t (cadr x))515 (return (compile-in g env t (cadr x))
518 (emit g 'ret))516 (emit g 'ret))
519 (set! (let* ((name (cadr x))517 (set! (let* ((name (cadr x))
520 (value (cddr x))518 (value (cddr x))
@@ -545,7 +543,7 @@ · 24 unmodified lines
545 543
546(def (lambda-vars l)544(def (lambda-vars l)
547 (def (check-formals l o opt kw)545 (def (check-formals l o opt kw)
548 (cond ((or (not l) (symbol? l)) #t)546 (cond ((or (not l) (symbol? l)) t)
549 ((and (cons? l) (symbol? (car l)))547 ((and (cons? l) (symbol? (car l)))
550 (if (or opt kw)548 (if (or opt kw)
551 (error "compile error: invalid argument list "549 (error "compile error: invalid argument list "
@@ -557,11 +555,11 @@ · 5 unmodified lines
557 (error "compile error: invalid optional argument " (car l)555 (error "compile error: invalid optional argument " (car l)
558 " in list " o))556 " in list " o))
559 (if (keyword? (caar l))557 (if (keyword? (caar l))
560 (check-formals (cdr l) o opt #t)558 (check-formals (cdr l) o opt t)
561 (if kw559 (if kw
562 (error "compile error: invalid argument list "560 (error "compile error: invalid argument list "
563 o ": keyword arguments must come last.")561 o ": keyword arguments must come last.")
564 (check-formals (cdr l) o #t kw))))562 (check-formals (cdr l) o t kw))))
565 ((cons? l)563 ((cons? l)
566 (error "compile error: invalid formal argument " (car l)564 (error "compile error: invalid formal argument " (car l)
567 " in list " o))565 " in list " o))
@@ -656,12 +654,12 @@ · 88 unmodified lines
656 (cond ((not vars) nil)654 (cond ((not vars) nil)
657 ((symbol? e)655 ((symbol? e)
658 (if (and nested (memq e vars))656 (if (and nested (memq e vars))
659 (put! capt e #t)))657 (put! capt e t)))
660 ((or (atom? e) (quoted? e)) nil)658 ((or (atom? e) (quoted? e)) nil)
661 ((eq? (car e) 'set!)659 ((eq? (car e) 'set!)
662 (if (memq (cadr e) vars)660 (if (memq (cadr e) vars)
663 (begin (put! setd (cadr e) #t)661 (begin (put! setd (cadr e) t)
664 (if nested (put! capt (cadr e) #t))))662 (if nested (put! capt (cadr e) t))))
665 (complex-bindings- (caddr e) vars nil nested capt setd))663 (complex-bindings- (caddr e) vars nil nested capt setd))
666 ((is-lambda? (car e))664 ((is-lambda? (car e))
667 (complex-bindings- (lambda:body e)665 (complex-bindings- (lambda:body e)
@@ -739,7 +737,7 @@ · 71 unmodified lines
739 ;; set initial stack pointer737 ;; set initial stack pointer
740 (aset! g 4 (+ (length vars) 4))738 (aset! g 4 (+ (length vars) 4))
741 ;; compile body and return739 ;; compile body and return
742 (compile-in g newenv #t (lambda:body f))740 (compile-in g newenv t (lambda:body f))
743 (emit g 'ret)741 (emit g 'ret)
744 (values (function (encode-byte-code (bcode:code g))742 (values (function (encode-byte-code (bcode:code g))
745 (const-to-idx-vec g) name)743 (const-to-idx-vec g) name)
src/docs_extra.lsp+2−2
@@ -10,10 +10,10 @@ · 9 unmodified lines
10 `(symbol-set-doc ',sym ',doc ',funvars)))10 `(symbol-set-doc ',sym ',doc ',funvars)))
11 11
12(doc-for (= a . rest)12(doc-for (= a . rest)
13 "Return #t if the arguments are equal.")13 "Return T if the arguments are equal.")
14 14
15(doc-for (nan? x)15(doc-for (nan? x)
16 "Return #t if the argument is NaN, regardless of the sign.")16 "Return T if the argument is NaN, regardless of the sign.")
17 17
18(doc-for (vm-stats)18(doc-for (vm-stats)
19 "Print various VM-related information, such as the number of GC calls19 "Print various VM-related information, such as the number of GC calls
src/flisp.c+1−3
@@ -22,7 +22,7 @@ value_t FL_builtins_table_sym, FL_quote, FL_lambda, FL_function, FL_comma, FL_co · 21 unmodified lines
22value_t FL_commadot, FL_trycatch, FL_backquote;22value_t FL_commadot, FL_trycatch, FL_backquote;
23value_t FL_conssym, FL_symbolsym, FL_fixnumsym, FL_vectorsym, FL_builtinsym, FL_vu8sym;23value_t FL_conssym, FL_symbolsym, FL_fixnumsym, FL_vectorsym, FL_builtinsym, FL_vu8sym;
24value_t FL_definesym, FL_defmacrosym, FL_forsym, FL_setqsym;24value_t FL_definesym, FL_defmacrosym, FL_forsym, FL_setqsym;
25value_t FL_tsym, FL_Tsym, FL_booleansym, FL_nullsym, FL_evalsym, FL_fnsym;25value_t FL_booleansym, FL_nullsym, FL_evalsym, FL_fnsym;
26value_t FL_nulsym, FL_alarmsym, FL_backspacesym, FL_tabsym, FL_linefeedsym, FL_newlinesym;26value_t FL_nulsym, FL_alarmsym, FL_backspacesym, FL_tabsym, FL_linefeedsym, FL_newlinesym;
27value_t FL_vtabsym, FL_pagesym, FL_returnsym, FL_escsym, FL_spacesym, FL_deletesym;27value_t FL_vtabsym, FL_pagesym, FL_returnsym, FL_escsym, FL_spacesym, FL_deletesym;
28value_t FL_IOError, FL_ParseError, FL_TypeError, FL_ArgError, FL_MemoryError;28value_t FL_IOError, FL_ParseError, FL_TypeError, FL_ArgError, FL_MemoryError;
@@ -1368,8 +1368,6 @@ failed: · 1339 unmodified lines
1368 FL_spacesym = csymbol("space");1368 FL_spacesym = csymbol("space");
1369 FL_deletesym = csymbol("delete");1369 FL_deletesym = csymbol("delete");
1370 FL_newlinesym = csymbol("newline");1370 FL_newlinesym = csymbol("newline");
1371 FL_tsym = csymbol("t");
1372 FL_Tsym = csymbol("T");
1373 FL_builtins_table_sym = csymbol("*builtins*");1371 FL_builtins_table_sym = csymbol("*builtins*");
1374 1372
1375 set(FL_printprettysym = csymbol("*print-pretty*"), FL_t);1373 set(FL_printprettysym = csymbol("*print-pretty*"), FL_t);
src/flisp.h+1−1
@@ -434,7 +434,7 @@ extern value_t FL_builtins_table_sym, FL_quote, FL_lambda, FL_function, FL_comma · 433 unmodified lines
434extern value_t FL_commadot, FL_trycatch, FL_backquote;434extern value_t FL_commadot, FL_trycatch, FL_backquote;
435extern value_t FL_conssym, FL_symbolsym, FL_fixnumsym, FL_vectorsym, FL_builtinsym, FL_vu8sym;435extern value_t FL_conssym, FL_symbolsym, FL_fixnumsym, FL_vectorsym, FL_builtinsym, FL_vu8sym;
436extern value_t FL_definesym, FL_defmacrosym, FL_forsym, FL_setqsym;436extern value_t FL_definesym, FL_defmacrosym, FL_forsym, FL_setqsym;
437extern value_t FL_tsym, FL_Tsym, FL_booleansym, FL_nullsym, FL_evalsym, FL_fnsym;437extern value_t FL_booleansym, FL_nullsym, FL_evalsym, FL_fnsym;
438extern value_t FL_nulsym, FL_alarmsym, FL_backspacesym, FL_tabsym, FL_linefeedsym, FL_newlinesym;438extern value_t FL_nulsym, FL_alarmsym, FL_backspacesym, FL_tabsym, FL_linefeedsym, FL_newlinesym;
439extern value_t FL_vtabsym, FL_pagesym, FL_returnsym, FL_escsym, FL_spacesym, FL_deletesym;439extern value_t FL_vtabsym, FL_pagesym, FL_returnsym, FL_escsym, FL_spacesym, FL_deletesym;
440extern value_t FL_IOError, FL_ParseError, FL_TypeError, FL_ArgError, FL_MemoryError;440extern value_t FL_IOError, FL_ParseError, FL_TypeError, FL_ArgError, FL_MemoryError;
src/print.c+2−2
@@ -418,9 +418,9 @@ fl_print_child(ios_t *f, value_t v) · 417 unmodified lines
418 break;418 break;
419 case TAG_FUNCTION:419 case TAG_FUNCTION:
420 if(v == FL_t)420 if(v == FL_t)
421 outsn(f, "#t", 2);421 outc(f, 'T');
422 else if(v == FL_nil)422 else if(v == FL_nil)
423 outsn(f, "nil", 3);423 outsn(f, "NIL", 3);
424 else if(v == FL_eof)424 else if(v == FL_eof)
425 outsn(f, "#<eof>", 6);425 outsn(f, "#<eof>", 6);
426 else if(v == FL_void){426 else if(v == FL_void){
src/read.c+16−9
@@ -363,17 +363,26 @@ peek(Rctx *ctx) · 362 unmodified lines
363 return ctx->toktype;363 return ctx->toktype;
364 ios_getc(RS);364 ios_getc(RS);
365 }else{365 }else{
366 if(!read_token(ctx, c, 0)){366 bool ok = read_token(ctx, c, 0);
367 if(ctx->buf[0] == '.' && ctx->buf[1] == '\0')367 const char *s = ctx->buf;
368 if(!ok){
369 if(s[0] == '.' && s[1] == '\0')
368 return (ctx->toktype = TOK_DOT);370 return (ctx->toktype = TOK_DOT);
369 if(fl_read_numtok(ctx->buf, &ctx->tokval, 0))371 if(fl_read_numtok(s, &ctx->tokval, 0))
370 return (ctx->toktype = TOK_NUM);372 return (ctx->toktype = TOK_NUM);
371 }373 }
372 ctx->toktype = TOK_SYM;374 ctx->toktype = TOK_SYM;
373 const char *name = (strcmp(ctx->buf, "lambda") == 0 || strcmp(ctx->buf, "λ") == 0) ? "λ" : ctx->buf;375 if(strcasecmp(s, "nil") == 0)
374 ctx->tokval = strcasecmp(name, "nil") == 0 ? FL_nil : symbol(name, name == ctx->buf);376 ctx->tokval = FL_nil;
375 if(name[strlen(name)-1] == '#')377 else if(s[1] == 0 && (s[0] == 't' || s[0] == 'T'))
376 ctx->toktype = TOK_GENSYM;378 ctx->tokval = FL_t;
379 else if(strcmp(s, "λ") == 0 || strcmp(s, "lambda") == 0)
380 ctx->tokval = FL_lambda;
381 else{
382 ctx->tokval = symbol(s, true);
383 if(s[strlen(s)-1] == '#')
384 ctx->toktype = TOK_GENSYM;
385 }
377 }386 }
378 return ctx->toktype;387 return ctx->toktype;
379}388}
@@ -645,8 +654,6 @@ do_read_sexpr(Rctx *ctx, value_t label) · 265 unmodified lines
645 return do_read_sexpr(ctx, label);654 return do_read_sexpr(ctx, label);
646 case TOK_SHARPSYM:655 case TOK_SHARPSYM:
647 sym = ctx->tokval;656 sym = ctx->tokval;
648 if(sym == FL_tsym || sym == FL_Tsym)
649 return FL_t;
650 // constructor notation657 // constructor notation
651 c = nextchar();658 c = nextchar();
652 ctx->loc = RS->loc;659 ctx->loc = RS->loc;
src/system.lsp+29−30
@@ -1,4 +1,3 @@
1; -*- scheme -*-
2; femtoLisp standard library1; femtoLisp standard library
3; by Jeff Bezanson (C) 20092; by Jeff Bezanson (C) 2009
4; Distributed under the BSD License3; Distributed under the BSD License
@@ -8,13 +7,13 @@ · 3 unmodified lines
8(def (void . rest)7(def (void . rest)
9 "Return the constant #<void> while ignoring any arguments.8 "Return the constant #<void> while ignoring any arguments.
10#<void> is mainly used when a function has side effects but does not9#<void> is mainly used when a function has side effects but does not
11produce any meaningful value to return, so even though #t or nil could10produce any meaningful value to return, so even though T or NIL could
12be returned instead, in case of #<void> alone, REPL will not print11be returned instead, in case of #<void> alone, REPL will not print
13it."12it."
14 #.(void))13 #.(void))
15 14
16(def (void? x)15(def (void? x)
17 "Return #t if x is #<void> and nil otherwise."16 "Return T if x is #<void>, NIL otherwise."
18 (eq? x #.(void)))17 (eq? x #.(void)))
19 18
20;;; syntax environment19;;; syntax environment
@@ -62,7 +61,7 @@ it." · 41 unmodified lines
62 nil61 nil
63 (let ((clause (car lst)))62 (let ((clause (car lst)))
64 (if (or (eq? (car clause) 'else)63 (if (or (eq? (car clause) 'else)
65 (eq? (car clause) #t))64 (eq? (car clause) t))
66 (if (not (cdr clause))65 (if (not (cdr clause))
67 (car clause)66 (car clause)
68 (cons 'begin (cdr clause)))67 (cons 'begin (cdr clause)))
@@ -104,9 +103,9 @@ it." · 35 unmodified lines
104(def (putprop sym key val)103(def (putprop sym key val)
105 (let ((kt (get *properties* key nil)))104 (let ((kt (get *properties* key nil)))
106 (unless kt105 (unless kt
107 (let ((t (table)))106 (let ((ta (table)))
108 (put! *properties* key t)107 (put! *properties* key ta)
109 (set! kt t)))108 (set! kt ta)))
110 (put! kt sym val)109 (put! kt sym val)
111 val))110 val))
112 111
@@ -169,7 +168,7 @@ it." · 56 unmodified lines
169 (lst (assv item (cdr lst)))))168 (lst (assv item (cdr lst)))))
170 169
171(def (> a . rest)170(def (> a . rest)
172 "Return #t if the arguments are in strictly decreasing order (previous171 "Return T if the arguments are in strictly decreasing order (previous
173one is greater than the next one)."172one is greater than the next one)."
174 (let loop ((a a) (rest rest))173 (let loop ((a a) (rest rest))
175 (or (not rest)174 (or (not rest)
@@ -179,7 +178,7 @@ one is greater than the next one)." · 3 unmodified lines
179 `(< ,@(reverse! rest) ,a))178 `(< ,@(reverse! rest) ,a))
180 179
181(def (<= a . rest)180(def (<= a . rest)
182 "Return #t if the arguments are in non-decreasing order (previous181 "Return T if the arguments are in non-decreasing order (previous
183one is less than or equal to the next one)."182one is less than or equal to the next one)."
184 (let loop ((a a) (rest rest))183 (let loop ((a a) (rest rest))
185 (or (not rest)184 (or (not rest)
@@ -188,7 +187,7 @@ one is less than or equal to the next one)." · 2 unmodified lines
188 (loop (car rest) (cdr rest))))))187 (loop (car rest) (cdr rest))))))
189 188
190(def (>= a . rest)189(def (>= a . rest)
191 "Return #t if the arguments are in non-increasing order (previous190 "Return T if the arguments are in non-increasing order (previous
192one is greater than or equal to the next one)."191one is greater than or equal to the next one)."
193 (let loop ((a a) (rest rest))192 (let loop ((a a) (rest rest))
194 (or (not rest)193 (or (not rest)
@@ -197,7 +196,7 @@ one is greater than or equal to the next one)." · 2 unmodified lines
197 (loop (car rest) (cdr rest))))))196 (loop (car rest) (cdr rest))))))
198 197
199(defmacro (/= a . rest)198(defmacro (/= a . rest)
200 "Return #t if not all arguments are equal. Shorthand for (not (= …))."199 "Return T if not all arguments are equal. Shorthand for (not (= …))."
201 `(not (= ,a ,@rest)))200 `(not (= ,a ,@rest)))
202 201
203(def (negative? x) (< x 0))202(def (negative? x) (< x 0))
@@ -228,8 +227,8 @@ one is greater than or equal to the next one)." · 24 unmodified lines
228 (foldl (λ (a b) (if (< a b) a b)) x0 xs)))227 (foldl (λ (a b) (if (< a b) a b)) x0 xs)))
229(def (char? x) (eq? (typeof x) 'rune))228(def (char? x) (eq? (typeof x) 'rune))
230(def (array? x) (or (vector? x)229(def (array? x) (or (vector? x)
231 (let ((t (typeof x)))230 (let ((tx (typeof x)))
232 (and (cons? t) (eq? (car t) 'array)))))231 (and (cons? tx) (eq? (car tx) 'array)))))
233(def (closure? x) (and (function? x) (not (builtin? x))))232(def (closure? x) (and (function? x) (not (builtin? x))))
234 233
235(def (caar x) (car (car x)))234(def (caar x) (car (car x)))
@@ -402,14 +401,14 @@ work and always terminates." · 166 unmodified lines
402 401
403(def (delete-duplicates lst)402(def (delete-duplicates lst)
404 (if (length> lst 20)403 (if (length> lst 20)
405 (let ((t (table)))404 (let ((ta (table)))
406 (let loop ((l lst) (acc '()))405 (let loop ((l lst) (acc '()))
407 (if (atom? l)406 (if (atom? l)
408 (reverse! acc)407 (reverse! acc)
409 (if (has? t (car l))408 (if (has? ta (car l))
410 (loop (cdr l) acc)409 (loop (cdr l) acc)
411 (begin410 (begin
412 (put! t (car l) #t)411 (put! ta (car l) t)
413 (loop (cdr l) (cons (car l) acc)))))))412 (loop (cdr l) (cons (car l) acc)))))))
414 (if (atom? lst)413 (if (atom? lst)
415 lst414 lst
@@ -620,7 +619,7 @@ work and always terminates." · 204 unmodified lines
620 619
621;;; debugging utilities620;;; debugging utilities
622 621
623(defmacro (assert expr) `(if ,expr #t (raise '(assert-failed ,expr))))622(defmacro (assert expr) `(if ,expr t (raise '(assert-failed ,expr))))
624 623
625(def traced?624(def traced?
626 (letrec ((sample-traced-lambda (λ args (begin (write (cons 'x args))625 (letrec ((sample-traced-lambda (λ args (begin (write (cons 'x args))
@@ -712,24 +711,24 @@ work and always terminates." · 85 unmodified lines
712 711
713;;; table functions712;;; table functions
714 713
715(def (table-pairs t)714(def (table-pairs ta)
716 (table-foldl (λ (k v z) (cons (cons k v) z))715 (table-foldl (λ (k v z) (cons (cons k v) z))
717 () t))716 nil ta))
718(def (table-keys t)717(def (table-keys ta)
719 (table-foldl (λ (k v z) (cons k z))718 (table-foldl (λ (k v z) (cons k z))
720 () t))719 nil ta))
721(def (table-values t)720(def (table-values ta)
722 (table-foldl (λ (k v z) (cons v z))721 (table-foldl (λ (k v z) (cons v z))
723 () t))722 nil ta))
724(def (table-clone t)723(def (table-clone ta)
725 (let ((nt (table)))724 (let ((nt (table)))
726 (table-foldl (λ (k v z) (put! nt k v))725 (table-foldl (λ (k v z) (put! nt k v))
727 () t)726 nil ta)
728 nt))727 nt))
729(def (table-invert t)728(def (table-invert ta)
730 (let ((nt (table)))729 (let ((nt (table)))
731 (table-foldl (λ (k v z) (put! nt v k))730 (table-foldl (λ (k v z) (put! nt v k))
732 () t)731 nil ta)
733 nt))732 nt))
734 733
735;;; string functions734;;; string functions
@@ -968,7 +967,7 @@ work and always terminates." · 232 unmodified lines
968 (when (trycatch (prompt)967 (when (trycatch (prompt)
969 (λ (e)968 (λ (e)
970 (top-level-exception-handler e)969 (top-level-exception-handler e)
971 #t))970 t))
972 (reploop)))971 (reploop)))
973 (reploop)972 (reploop)
974 (newline))973 (newline))
@@ -1075,7 +1074,7 @@ work and always terminates." · 100 unmodified lines
1075 *print-level* *print-length* *os-name* *interactive*1074 *print-level* *print-length* *os-name* *interactive*
1076 *prompt* *os-version* procedure? top-level-bound?)))1075 *prompt* *os-version* procedure? top-level-bound?)))
1077 (with-bindings ((*print-pretty* nil)1076 (with-bindings ((*print-pretty* nil)
1078 (*print-readably* #t))1077 (*print-readably* t))
1079 (let* ((syms1078 (let* ((syms
1080 (filter (λ (s)1079 (filter (λ (s)
1081 (and (bound? s)1080 (and (bound? s)
@@ -1138,7 +1137,7 @@ Default function prints \"#;> \"." defprompt)) · 56 unmodified lines
1138 (set! *interactive* nil)1137 (set! *interactive* nil)
1139 (__script (cadr argv)))1138 (__script (cadr argv)))
1140 (begin (set! *argv* argv)1139 (begin (set! *argv* argv)
1141 (set! *interactive* #t)1140 (set! *interactive* t)
1142 (__rcscript)1141 (__rcscript)
1143 (repl)))1142 (repl)))
1144 (exit 0))1143 (exit 0))
test/ast/asttools.lsp+38−38
@@ -12,7 +12,7 @@ · 11 unmodified lines
12(def (index-of item lst start)12(def (index-of item lst start)
13 (cond ((not lst) nil)13 (cond ((not lst) nil)
14 ((eq? item (car lst)) start)14 ((eq? item (car lst)) start)
15 (#t (index-of item (cdr lst) (+ start 1)))))15 (else (index-of item (cdr lst) (+ start 1)))))
16 16
17(def (each f l)17(def (each f l)
18 (if (not l) l18 (if (not l) l
@@ -31,15 +31,15 @@ · 12 unmodified lines
31 (let ((new-t (map (lambda (e) (maptree-post f e)) tr)))31 (let ((new-t (map (lambda (e) (maptree-post f e)) tr)))
32 (f new-t))))32 (f new-t))))
33 33
34(def (foldtree-pre f t zero)34(def (foldtree-pre f tr zero)
35 (if (not (cons? t))35 (if (not (cons? tr))
36 (f t zero)36 (f tr zero)
37 (foldl t (lambda (e state) (foldtree-pre f e state)) (f t zero))))37 (foldl tr (lambda (e state) (foldtree-pre f e state)) (f tr zero))))
38 38
39(def (foldtree-post f t zero)39(def (foldtree-post f tr zero)
40 (if (not (cons? t))40 (if (not (cons? tr))
41 (f t zero)41 (f tr zero)
42 (f t (foldl t (lambda (e state) (foldtree-post f e state)) zero))))42 (f tr (foldl tr (lambda (e state) (foldtree-post f e state)) zero))))
43 43
44; general tree transformer44; general tree transformer
45; folds in preorder (foldtree-pre), maps in postorder (maptree-post)45; folds in preorder (foldtree-pre), maps in postorder (maptree-post)
@@ -48,39 +48,39 @@ · 2 unmodified lines
48; approach.48; approach.
49; (mapper tree state) - should return transformed tree given current state49; (mapper tree state) - should return transformed tree given current state
50; (folder tree state) - should return new state50; (folder tree state) - should return new state
51(def (map&fold t zero mapper folder)51(def (map&fold tr zero mapper folder)
52 (let ((head (and (cons? t) (car t))))52 (let ((head (and (cons? tr) (car tr))))
53 (cond ((eq? head 'quote)53 (cond
54 t)54 ((eq? head 'quote) tr)
55 ((or (eq? head 'the) (eq? head 'meta))55 ((or (eq? head 'the) (eq? head 'meta))
56 (list head56 (list head
57 (cadr t)57 (cadr tr)
58 (map&fold (caddr t) zero mapper folder)))58 (map&fold (caddr tr) zero mapper folder)))
59 (else59 (else
60 (let ((new-s (folder t zero)))60 (let ((new-s (folder tr zero)))
61 (mapper61 (mapper
62 (if (cons? t)62 (if (cons? tr)
63 ; head symbol is a tag; never transform it63 ; head symbol is a tag; never transform it
64 (cons (car t)64 (cons (car tr)
65 (map (lambda (e) (map&fold e new-s mapper folder))65 (map (lambda (e) (map&fold e new-s mapper folder))
66 (cdr t)))66 (cdr tr)))
67 t)67 tr)
68 new-s))))))68 new-s))))))
69 69
70; convert to proper list, i.e. remove "dots", and append70; convert to proper list, i.e. remove "dots", and append
71(def (append.2 l tail)71(def (append.2 l tail)
72 (cond ((not l) tail)72 (cond ((not l) tail)
73 ((atom? l) (cons l tail))73 ((atom? l) (cons l tail))
74 (#t (cons (car l) (append.2 (cdr l) tail)))))74 (else (cons (car l) (append.2 (cdr l) tail)))))
75 75
76; transform code by calling (f expr env) on each subexpr, where76; transform code by calling (f expr env) on each subexpr, where
77; env is a list of lexical variables in effect at that point.77; env is a list of lexical variables in effect at that point.
78(def (lexical-walk f t)78(def (lexical-walk f tr)
79 (map&fold t () f79 (map&fold tr () f
80 (lambda (tree state)80 (lambda (tree state)
81 (if (and (eq? (car t) 'lambda)81 (if (and (eq? (car tr) 'lambda)
82 (cons? (cdr t)))82 (cons? (cdr tr)))
83 (append.2 (cadr t) state)83 (append.2 (cadr tr) state)
84 state))))84 state))))
85 85
86; collapse forms like (&& (&& (&& (&& a b) c) d) e) to (&& a b c d e)86; collapse forms like (&& (&& (&& (&& a b) c) d) e) to (&& a b c d e)
@@ -118,7 +118,7 @@ · 31 unmodified lines
118 (map (lambda (se) (lvc- se newenv))118 (map (lambda (se) (lvc- se newenv))
119 (cddr e))))119 (cddr e))))
120 (map (lambda (se) (lvc- se env)) e)))))120 (map (lambda (se) (lvc- se env)) e)))))
121 (#t e)))121 (else e)))
122(def (lexical-var-conversion e)122(def (lexical-var-conversion e)
123 (lvc- e ()))123 (lvc- e ()))
124 124
@@ -137,19 +137,19 @@ · 12 unmodified lines
137 (map&fold e137 (map&fold e
138 ()138 ()
139 ; mapper: replace symbol if unbound139 ; mapper: replace symbol if unbound
140 (lambda (t env)140 (lambda (te env)
141 (if (symbol? t)141 (if (symbol? te)
142 (let ((found (assq t transl)))142 (let ((found (assq te transl)))
143 (if (and found143 (if (and found
144 (not (memq t env)))144 (not (memq te env)))
145 (cdr found)145 (cdr found)
146 t))146 te))
147 t))147 te))
148 ; folder: add locals to environment if entering a new scope148 ; folder: add locals to environment if entering a new scope
149 (lambda (t env)149 (lambda (te env)
150 (if (and (cons? t) (or (eq? (car t) 'let)150 (if (and (cons? te) (or (eq? (car te) 'let)
151 (eq? (car t) 'lambda)))151 (eq? (car te) 'lambda)))
152 (append (cadr t) env)152 (append (cadr te) env)
153 env))))153 env))))
154 154
155; flatten op with any associativity155; flatten op with any associativity
test/ast/match.lsp+13−13
@@ -4,7 +4,7 @@ · 3 unmodified lines
4 4
5(def (unique lst)5(def (unique lst)
6 (if (not lst)6 (if (not lst)
7 ()7 nil
8 (cons (car lst)8 (cons (car lst)
9 (filter (lambda (x) (not (eq? x (car lst))))9 (filter (lambda (x) (not (eq? x (car lst))))
10 (unique (cdr lst))))))10 (unique (cdr lst))))))
@@ -20,7 +20,7 @@ · 9 unmodified lines
20; p is an expression in the following pattern language:20; p is an expression in the following pattern language:
21;21;
22; _ match anything, not captured22; _ match anything, not captured
23; <func> any scheme function; matches if (func expr) returns #t23; <func> any scheme function; matches if (func expr) returns T
24; <var> match anything and capture as <var>. future occurrences of <var> in the pattern24; <var> match anything and capture as <var>. future occurrences of <var> in the pattern
25; must match the same thing.25; must match the same thing.
26; (head <p1> <p2> etc) match an s-expr with 'head' matched literally, and the rest of the26; (head <p1> <p2> etc) match an s-expr with 'head' matched literally, and the rest of the
@@ -41,7 +41,7 @@ · 14 unmodified lines
41(def (match- p expr state)41(def (match- p expr state)
42 (cond ((symbol? p)42 (cond ((symbol? p)
43 (cond ((eq? p '_) state)43 (cond ((eq? p '_) state)
44 (#t44 (else
45 (let ((capt (assq p state)))45 (let ((capt (assq p state)))
46 (if capt46 (if capt
47 (and (equal? expr (cdr capt)) state)47 (and (equal? expr (cdr capt)) state)
@@ -57,13 +57,13 @@ · 9 unmodified lines
57 (and (match- (caddr p) expr state)57 (and (match- (caddr p) expr state)
58 (cons (cons (cadr p) expr) state)))58 (cons (cons (cadr p) expr) state)))
59 ((eq? (car p) '-$) ; greedy alternation for toplevel pattern59 ((eq? (car p) '-$) ; greedy alternation for toplevel pattern
60 (match-alt (cdr p) () (list expr) state nil 1))60 (match-alt (cdr p) nil (list expr) state nil 1))
61 (#t61 (else
62 (and (cons? expr)62 (and (cons? expr)
63 (equal? (car p) (car expr))63 (equal? (car p) (car expr))
64 (match-seq (cdr p) (cdr expr) state (length (cdr expr)))))))64 (match-seq (cdr p) (cdr expr) state (length (cdr expr)))))))
65 65
66 (#t66 (else
67 (and (equal? p expr) state))))67 (and (equal? p expr) state))))
68 68
69; match an alternation69; match an alternation
@@ -95,17 +95,17 @@ · 25 unmodified lines
95 (match-star- p prest (cdr expr) state var (- min 1) (- max 1) (- L 1)95 (match-star- p prest (cdr expr) state var (- min 1) (- max 1) (- L 1)
96 (cons (car expr) sofar))))96 (cons (car expr) sofar))))
97 ; otherwise, must match either 0 or between 1 and max subexpressions97 ; otherwise, must match either 0 or between 1 and max subexpressions
98 (#t98 (else
99 (or (match-star- p prest expr state var 0 0 L sofar)99 (or (match-star- p prest expr state var 0 0 L sofar)
100 (match-star- p prest expr state var 1 max L sofar)))))100 (match-star- p prest expr state var 1 max L sofar)))))
101(def (match-star p prest expr state var min max L)101(def (match-star p prest expr state var min max L)
102 (match-star- p prest expr state var min max L ()))102 (match-star- p prest expr state var min max L nil))
103 103
104; match sequences of expressions104; match sequences of expressions
105(def (match-seq p expr state L)105(def (match-seq p expr state L)
106 (cond ((not state) nil)106 (cond ((not state) nil)
107 ((not p) (if (not expr) state nil))107 ((not p) (if (not expr) state nil))
108 (#t108 (else
109 (let ((subp (car p))109 (let ((subp (car p))
110 (var nil))110 (var nil))
111 (if (and (cons? subp)111 (if (and (cons? subp)
@@ -113,7 +113,7 @@ · 1 unmodified line
113 (begin (set! var (cadr subp))113 (begin (set! var (cadr subp))
114 (set! subp (caddr subp)))114 (set! subp (caddr subp)))
115 nil)115 nil)
116 (let ((head (if (cons? subp) (car subp) ())))116 (let ((head (if (cons? subp) (car subp) nil)))
117 (cond ((eq? subp '...)117 (cond ((eq? subp '...)
118 (match-star '_ (cdr p) expr state var 0 L L))118 (match-star '_ (cdr p) expr state var 0 L L))
119 ((eq? head '-*)119 ((eq? head '-*)
@@ -124,7 +124,7 @@ · 4 unmodified lines
124 (match-star (cadr subp) (cdr p) expr state var 0 1 L))124 (match-star (cadr subp) (cdr p) expr state var 0 1 L))
125 ((eq? head '-$)125 ((eq? head '-$)
126 (match-alt (cdr subp) (cdr p) expr state var L))126 (match-alt (cdr subp) (cdr p) expr state var L))
127 (#t127 (else
128 (and (cons? expr)128 (and (cons? expr)
129 (match-seq (cdr p) (cdr expr)129 (match-seq (cdr p) (cdr expr)
130 (match- (car p) (car expr) state)130 (match- (car p) (car expr) state)
@@ -140,10 +140,10 @@ · 9 unmodified lines
140 140
141 ((cons? p)141 ((cons? p)
142 (if (eq? (car p) '-/)142 (if (eq? (car p) '-/)
143 ()143 nil
144 (unique (apply append (map patargs- (cdr p))))))144 (unique (apply append (map patargs- (cdr p))))))
145 145
146 (#t ())))146 (else nil)))
147(def (patargs p)147(def (patargs p)
148 (cons '__ (patargs- p)))148 (cons '__ (patargs- p)))
149 149
test/ast/rpasses.lsp+6−6
@@ -14,7 +14,7 @@ · 13 unmodified lines
14 14
15(def (func-argnames f)15(def (func-argnames f)
16 (let ((argl (cadr f)))16 (let ((argl (cadr f)))
17 (if (eq? argl '*r-null*) ()17 (if (eq? argl '*r-null*) nil
18 (map cadr argl))))18 (map cadr argl))))
19 19
20; transformations20; transformations
@@ -49,7 +49,7 @@ · 28 unmodified lines
49 (<<- (r-call f lhs ...) rhs))49 (<<- (r-call f lhs ...) rhs))
50 (let ((g (if (cons? rhs) (r-gensym) rhs))50 (let ((g (if (cons? rhs) (r-gensym) rhs))
51 (op (car __)))51 (op (car __)))
52 `(r-block ,@(if (cons? rhs) `((ref= ,g ,rhs)) ())52 `(r-block ,@(if (cons? rhs) `((ref= ,g ,rhs)) nil)
53 (,op ,lhs (r-call ,(symconcat f '<-) ,@(cddr (cadr __)) ,g))53 (,op ,lhs (r-call ,(symconcat f '<-) ,@(cddr (cadr __)) ,g))
54 ,g)))54 ,g)))
55 e))55 e))
@@ -80,14 +80,14 @@ · 24 unmodified lines
80 e))80 e))
81 81
82(def (find-assigned-vars n)82(def (find-assigned-vars n)
83 (let ((vars ()))83 (let ((vars nil))
84 (maptree-pre (lambda (s)84 (maptree-pre (lambda (s)
85 (if (not (cons? s)) s85 (if (not (cons? s)) s
86 (cond ((eq? (car s) 'lambda) ())86 (cond ((eq? (car s) 'lambda) nil)
87 ((eq? (car s) '<-)87 ((eq? (car s) '<-)
88 (set! vars (list-adjoin (cadr s) vars))88 (set! vars (list-adjoin (cadr s) vars))
89 (cddr s))89 (cddr s))
90 (#t s))))90 (else s))))
91 n)91 n)
92 vars))92 vars))
93 93
@@ -96,7 +96,7 @@ · 2 unmodified lines
96 (maptree-post (lambda (n)96 (maptree-post (lambda (n)
97 (if (and (cons? n) (eq? (car n) 'lambda))97 (if (and (cons? n) (eq? (car n) 'lambda))
98 (let ((vars (find-assigned-vars (cddr n))))98 (let ((vars (find-assigned-vars (cddr n))))
99 `(lambda ,(cadr n) (let ,(map (lambda (v) (list v ()))99 `(lambda ,(cadr n) (let ,(map (lambda (v) (list v nil))
100 vars)100 vars)
101 ,@(cddr n))))101 ,@(cddr n))))
102 n))102 n))
test/hashtest.lsp+0−24
@@ -1,5 +1,3 @@
1; -*- scheme -*-
2
3(def (hins1)1(def (hins1)
4 (let ((h (table)))2 (let ((h (table)))
5 (dotimes (n 200000)3 (dotimes (n 200000)
@@ -16,25 +14,3 @@ · 10 unmodified lines
16(time (dotimes (i 100000) (table :a 1 :b 2 :c 3 :d 4)))14(time (dotimes (i 100000) (table :a 1 :b 2 :c 3 :d 4)))
17(time (dotimes (i 100000) (table :a 1 :b 2)))15(time (dotimes (i 100000) (table :a 1 :b 2)))
18(time (dotimes (i 100000) (table)))16(time (dotimes (i 100000) (table)))
19
20#t
21
22#|
23
24with HT_N_INLINE==16
25Elapsed time: 0.0796329975128174 seconds
26Elapsed time: 0.0455679893493652 seconds
27Elapsed time: 0.0272290706634521 seconds
28Elapsed time: 0.0177979469299316 seconds
29Elapsed time: 0.0102229118347168 seconds
30
31
32with HT_N_INLINE==8
33
34Elapsed time: 0.1010119915008545 seconds
35Elapsed time: 0.174872875213623 seconds
36Elapsed time: 0.0322129726409912 seconds
37Elapsed time: 0.0195930004119873 seconds
38Elapsed time: 0.008836030960083 seconds
39
40|#
test/test.lsp+4−6
@@ -1,5 +1,3 @@
1; -*- scheme -*-
2
3; make label self-evaluating, but evaluating the lambda in the process1; make label self-evaluating, but evaluating the lambda in the process
4;(defmacro labl (name f)2;(defmacro labl (name f)
5; (list list ''labl (list 'quote name) f))3; (list list ''labl (list 'quote name) f))
@@ -18,10 +16,10 @@ · 12 unmodified lines
18 (λ (lsts)16 (λ (lsts)
19 (cond ((not lsts) ())17 (cond ((not lsts) ())
20 ((not (cdr lsts)) (car lsts))18 ((not (cdr lsts)) (car lsts))
21 (#t ((label append2 (λ (l d)19 (t ((label append2 (λ (l d)
22 (if (not l) d20 (if (not l) d
23 (cons (car l)21 (cons (car l)
24 (append2 (cdr l) d)))))22 (append2 (cdr l) d)))))
25 (car lsts) (append-h (cdr lsts)))))))23 (car lsts) (append-h (cdr lsts)))))))
26 lsts))24 lsts))
27 25
test/tme.lsp+2−2
@@ -1,3 +1,3 @@
1(let ((t (table)))1(let ((ta (table)))
2 (time (dotimes (i 2000000)2 (time (dotimes (i 2000000)
3 (put! t (rand) (rand)))))3 (put! ta (rand) (rand)))))
test/unittest.lsp+19−19
@@ -1,7 +1,7 @@
1; -*- scheme -*-1; -*- scheme -*-
2(defmacro (assert-fail expr . what)2(defmacro (assert-fail expr . what)
3 `(assert (trycatch (begin ,expr nil)3 `(assert (trycatch (begin ,expr nil)
4 (λ (e) ,(if (not what) #t4 (λ (e) ,(if (not what) t
5 `(eq? (car e) ',(car what)))))))5 `(eq? (car e) ',(car what)))))))
6 6
7(def (every-int n)7(def (every-int n)
@@ -196,7 +196,7 @@ · 188 unmodified lines
196(for 1 10 (λ (i) 0))196(for 1 10 (λ (i) 0))
197 197
198; and, or198; and, or
199(assert (equal? #t (and)))199(assert (equal? t (and)))
200(assert (equal? nil (or)))200(assert (equal? nil (or)))
201(assert (equal? 1 (and '(1) 'x 1)))201(assert (equal? 1 (and '(1) 'x 1)))
202(assert (equal? 1 (or nil nil nil nil nil 1 nil nil nil nil)))202(assert (equal? 1 (or nil nil nil nil nil 1 nil nil nil nil)))
@@ -404,7 +404,7 @@ · 201 unmodified lines
404 404
405;; unbinding405;; unbinding
406(def abc 1)406(def abc 1)
407(assert (equal? (bound? 'abc) #t))407(assert (equal? (bound? 'abc) t))
408(assert (equal? (eval '(+ abc 1)) 2))408(assert (equal? (eval '(+ abc 1)) 2))
409(makunbound 'abc)409(makunbound 'abc)
410(assert (equal? (bound? 'abc) nil))410(assert (equal? (bound? 'abc) nil))
@@ -514,7 +514,7 @@ · 103 unmodified lines
514(def s "привет\0пока")514(def s "привет\0пока")
515 515
516(assert (equal? s (string-encode (string-decode s))))516(assert (equal? s (string-encode (string-decode s))))
517(assert (equal? (string s "\0") (string-encode (string-decode s #t))))517(assert (equal? (string s "\0") (string-encode (string-decode s t))))
518 518
519(assert (eq? 21 (sizeof s)))519(assert (eq? 21 (sizeof s)))
520(assert (eq? 21 (length s)))520(assert (eq? 21 (length s)))
@@ -716,24 +716,24 @@ · 195 unmodified lines
716(assert (= (length (table "hello" "goodbye" 123 456)) 2))716(assert (= (length (table "hello" "goodbye" 123 456)) 2))
717(assert-fail (table 1))717(assert-fail (table 1))
718(assert-fail (table 1 2 3))718(assert-fail (table 1 2 3))
719(def t (table 1 2 "3" 4 'foo 'bar))719(def ta (table 1 2 "3" 4 'foo 'bar))
720(let ((b (buffer)))720(let ((b (buffer)))
721 (write t b)721 (write ta b)
722 (assert (equal? (iostream->string b) "#table(1 2 \"3\" 4 foo bar)")))722 (assert (equal? (iostream->string b) "#table(1 2 \"3\" 4 foo bar)")))
723(assert (table? t))723(assert (table? ta))
724(assert (not (table? "nope")))724(assert (not (table? "nope")))
725(assert-fail (get t 3))725(assert-fail (get ta 3))
726(assert-fail (get t "foo"))726(assert-fail (get ta "foo"))
727(assert-fail (get t 1+))727(assert-fail (get ta 1+))
728(assert (= 2 (get t 1)))728(assert (= 2 (get ta 1)))
729(assert (= 4 (get t "3")))729(assert (= 4 (get ta "3")))
730 730
731(assert (has? t 'foo))731(assert (has? ta 'foo))
732(assert (eq? 'bar (get t 'foo)))732(assert (eq? 'bar (get ta 'foo)))
733(assert (eq? t (del! t 'foo)))733(assert (eq? ta (del! ta 'foo)))
734(assert (not (has? t 'foo)))734(assert (not (has? ta 'foo)))
735(assert-fail (get t 'foo))735(assert-fail (get ta 'foo))
736(assert-fail (del! t 'foo))736(assert-fail (del! ta 'foo))
737 737
738(assert-fail (get "blah" 0))738(assert-fail (get "blah" 0))
739(assert-fail (get (list 0 1) 0))739(assert-fail (get (list 0 1) 0))
tools/gen.lsp+3−3
@@ -13,15 +13,15 @@ · 12 unmodified lines
13 OP_RET ret nil nil nil13 OP_RET ret nil nil nil
14 OP_DUP dup nil nil nil14 OP_DUP dup nil nil nil
15 OP_CAR car 1 (λ (x) (car x)) (15 OP_CAR car 1 (λ (x) (car x)) (
16 ((lst) "Returns the first element of a list or nil if not available."))16 ((lst) "Return the first element of a list or NIL if not available."))
17 OP_CDR cdr 1 (λ (x) (cdr x)) (17 OP_CDR cdr 1 (λ (x) (cdr x)) (
18 ((lst) "Returns the tail of a list or nil if not available."))18 ((lst) "Return the tail of a list or NIL if not available."))
19 OP_CLOSURE closure nil nil nil19 OP_CLOSURE closure nil nil nil
20 OP_SETA seta nil nil nil20 OP_SETA seta nil nil nil
21 OP_JMP jmp nil nil nil21 OP_JMP jmp nil nil nil
22 OP_LOADC0 loadc0 nil nil nil22 OP_LOADC0 loadc0 nil nil nil
23 OP_CONSP cons? 1 (λ (x) (cons? x)) (23 OP_CONSP cons? 1 (λ (x) (cons? x)) (
24 ((value) "Returns #t if the value is a cons cell."))24 ((value) "Return T if the value is a cons cell."))
25 OP_BRNE brne nil nil nil25 OP_BRNE brne nil nil nil
26 OP_LOADT loadt nil nil nil26 OP_LOADT loadt nil nil nil
27 OP_LOAD0 load0 nil nil nil27 OP_LOAD0 load0 nil nil nil

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t