From e271cdf5198727a9027c64e430346b56ed69778a Mon Sep 17 00:00:00 2001 From: crc Date: Wed, 12 Feb 2020 20:08:04 +0000 Subject: [PATCH] retro.forth: smaller, cleaner `a:append`, `a:prepend` FossilOrigin-Name: ddadcd3feb9843c18dfe8023044da4c7c0501559caf5fe9dade58eab25dbac47 --- image/retro.forth | 13 +- ngaImage | Bin 37352 -> 37304 bytes vm/nga-c/retro-image.c | 737 ++++++++++++++++++++--------------------- 3 files changed, 372 insertions(+), 378 deletions(-) diff --git a/image/retro.forth b/image/retro.forth index 4d3c19d..ba335cb 100644 --- a/image/retro.forth +++ b/image/retro.forth @@ -1386,15 +1386,10 @@ from one location to another. I then define `a:append` and `a:prepend` to combine arrays. ~~~ -{{ - :copy dup fetch [ &, a:for-each ] dip ; ----reveal--- - :a:prepend (aa-a) - here #0 , [ copy swap copy + ] dip &store sip ; - - :a:append (aa-a) - swap a:prepend ; -}} +:a:append (aa-a) + dup-pair [ fetch ] bi@ + here [ , [ &, a:for-each ] bi@ ] dip ; +:a:prepend (aa-a) + swap a:append ; ~~~ `a:chop` returns a new array containing all but the last value diff --git a/ngaImage b/ngaImage index a858cd45f10aad9a667eb7a245ada8d30fc48737..70581fb601896190603b952c2629205598a50573 100644 GIT binary patch delta 2642 zcmaJ@Z%k8H6o0SykTOfHU8x01txsr1=V~VeoFXCyf{N1^%}izj+njUL#p#?yfl?4C zLb2qi)5I-dO3b!ICHP@{aE>fw;R9x9Ty$A9#?3hA+%R({PISNXdSBBqVw02eJLmk) zpL_3n_x1L1!&k=*CV8qPJ;m?!Ig+%k&t&y0M^s5V*`MS0mK&}+X>lNLxtt|_GUO&~j=u}Bun&42c+7n)Vq4e``=OIEKFY|upOB)LxhH(DAf0`eV5eo% z7rS4wO%YYE!==%)B`J&Q11ppnKrhosz$cf|cwnI;A2#<7Wc_!J)wHHol`Cmitxw4X zXDiL!m~C0IsSoHqn~E1Od5 zGU%JVGyP*QF_|P!D57l${J$ln{={4|)>Zh;u4iW%5!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