shithub: femtolisp

Download patch

ref: 547836a03d5d3cd2dc0d7459edafeb4c6d677415
parent: a4f25a806f45195df93398688e7e2683c2b73890
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Sun Dec 1 08:30:30 EST 2024

compiler: remove now unused compile-for

--- a/compiler.lsp
+++ b/compiler.lsp
@@ -314,17 +314,6 @@
        (pair? (cadr func))
        (length= (cadr func) 1)))
 
-(define (compile-for g env lo hi func)
-  (if (1arg-lambda? func)
-      (begin (compile-in g env #f lo)
-             (bcode:stack g 1)
-             (compile-in g env #f hi)
-             (bcode:stack g 1)
-             (compile-in g env #f func)
-             (emit g 'for)
-             (bcode:stack g -2))
-      (error "for: third form must be a 1-argument lambda")))
-
 (define (compile-short-circuit g env tail? forms default branch)
   (cond ((atom? forms)        (compile-in g env tail? default))
         ((atom? (cdr forms))  (compile-in g env tail? (car forms)))
@@ -505,7 +494,6 @@
            (and      (compile-and g env tail? (cdr x)))
            (or       (compile-or  g env tail? (cdr x)))
            (while    (compile-while g env (cadr x) (cons 'begin (cddr x))))
-           (for      (compile-for   g env (cadr x) (caddr x) (cadddr x)))
            (return   (compile-in g env #t (cadr x))
                      (emit g 'ret))
            (set!     (unless (symbol? (cadr x))
--- a/flisp.boot
+++ b/flisp.boot
@@ -141,11 +141,9 @@
   emit-optional-arg-inits > 255 largc lvargc vargc argc extend-env
   complex-bindings lambda:body box-vars compile-in ret values #fn(function)
   encode-byte-code bcode:code const-to-idx-vec bcode:cenv) compile-f-)
-	    compile-for #fn("9000n57084513n07101O82544720K5247101O83544720K5247101O8454473024524720r.62:752661:" #(1arg-lambda?
-  compile-in bcode:stack emit for error "for: third form must be a 1-argument lambda") compile-for)
 	    compile-if #fn("@000n4700517005183T718351728351B3;0738351@6074508:DC=07501828;64:8:OC=07501828<64:7501O8:54476027885347501828;544823<07602852@;076029895347:0885247501828<5447:08962:" #(make-label
   caddr cdddr cadddr void compile-in emit brf ret jmp mark-label) compile-if)
-	    compile-in #fn("=000n483R3<0700183D64:83H3\xaf083EC:07102262:83KC:07102362:83DC:07102462:83OC:07102562:83qC:07102662:7783513<0710288363:2983513C07:01822;2<51e164:7102=8363:83<RS;ID0483<Z;I;047>83<1523=07?01828364:83<882@CS07A83T513>07:018283T64:7102=83T63:882BC=07C01828364:882DC>07E018283=64:882FC;07G018363:882HCD07I2J183>22K01>262:882LC>07M018283=64:882NC>07O018283=64:882PCE07Q0183T2D7R8351P64:882SCH07T0183T7U83517V835165:882WCE07:01D83T5447102X62:882YCT083TR360O@807Z2[5147\\0183T7U835164:882]Cp07:01O2Hq83Te35447^7U835151360O@807Z2_5147:01O7U83515447102]62:7?01828364:" #(compile-sym
+	    compile-in #fn("=000n483R3<0700183D64:83H3\xaf083EC:07102262:83KC:07102362:83DC:07102462:83OC:07102562:83qC:07102662:7783513<0710288363:2983513C07:01822;2<51e164:7102=8363:83<RS;ID0483<Z;I;047>83<1523=07?01828364:83<882@CS07A83T513>07:018283T64:7102=83T63:882BC=07C01828364:882DC>07E018283=64:882FC;07G018363:882HCD07I2J183>22K01>262:882LC>07M018283=64:882NC>07O018283=64:882PCE07Q0183T2D7R8351P64:882SCE07:01D83T5447102T62:882UCT083TR360O@807V2W5147X0183T7Y835164:882ZCp07:01O2Hq83Te35447[7Y835151360O@807V2\\5147:01O7Y83515447102Z62:7?01828364:" #(compile-sym
   emit load0 load1 loadt loadf loadnil fits-i8 loadi8 #fn(eof-object?)
   compile-in #fn(top-level-value) eof-object loadv in-env? compile-app quote
   self-evaluating? if compile-if begin compile-begin prog1 compile-prog1 λ
@@ -153,9 +151,9 @@
   #fn("9000n270A2105341\x85K02223AF>2152470A242515163:D:" #(emit loadv #fn(for-each)
 							    #fn("9000n170AF0O64:" #(compile-sym))
 							    closure #fn(length)))
-  and compile-and or compile-or while compile-while cddr for compile-for caddr
-  cadddr return ret set! error "set!: second argument must be a symbol"
-  compile-set! trycatch 1arg-lambda? "trycatch: second form must be a 1-argument lambda") compile-in)
+  and compile-and or compile-or while compile-while cddr return ret set! error
+  "set!: second argument must be a symbol" compile-set! caddr trycatch
+  1arg-lambda? "trycatch: second form must be a 1-argument lambda") compile-in)
 	    compile-let #fn("A000n483<83=7005188T71018953728;737488518;528:537508=524268=1<521=P7708>827488515447808<U524798<E52;360482S3<07:02;8<63:D:" #(bcode:sp
   compile-arglist vars-to-env complex-bindings caddr box-vars #fn(nconc)
   compile-in bcode:stack > emit shift) compile-let)
@@ -203,7 +201,7 @@
   keyargs " " brbound (jmp brf brt brne brnn brn) "@" hex5 ref-int16-LE (jmp.l
   brf.l brt.l brne.l brnn.l brn.l)) disassemble)
 	    div #fn("7000n201k0EL;3C041EL;3404K;I504r/;I404EM:" #() div) emit
-	    #fn("P000z282Jb0120Q;3C040EGB;3:040EG<21Q3;00EG22_@:00E10EGPp@\xb9123124523A075082<52e1?2@30D4261275287;3<047882<29523:087T?1@30D^142612:5287;3<047882<29523:087T?1@30D^1412;C\\0822<d3=02=?14q?2@F0822>d3=02??14q?2@30O@30D412@C\\0822<d3=02A?14q?2@F0822>d3=02B?14q?2@30O@30D40EGB3900EG<@30q0EG12CQ;3\x9f04872DQ;390488T2EQ3E00E82<2F7G8851PPp@x0872DCB00E82<2H88=PPp@a0872ICB00E82<2J88=PPp@J0872ECB00E82<2K88=PPp@30O;Ia0412HQ;3804872EQ3B00E82<2F88=PPp@?00E7L182P8852p^240:" #(car
+	    #fn("P000z20EG82J^0120Q;3A0487B;390487<21Q3:08722_@900E187Pp@\xb4123124523A075082<52e1?2@30D4261275288;3<047882<29523:088T?1@30D^142612:5288;3<047882<29523:088T?1@30D^1412;C\\0822<d3=02=?14q?2@F0822>d3=02??14q?2@30O@30D412@C\\0822<d3=02A?14q?2@F0822>d3=02B?14q?2@30O@30D487B38087<@30q12CQ;3\x9f04882DQ;390487T2EQ3E00E82<2F7G8751PPp@x0882DCB00E82<2H87=PPp@a0882ICB00E82<2J87=PPp@J0882ECB00E82<2K87=PPp@30O;Ia0412HQ;3804882EQ3B00E82<2F87=PPp@?00E7L182P8752p^140:" #(car
   cdr cadr #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)