From bb82fcaa36e963c1ef5e09b85395221beba846d1 Mon Sep 17 00:00:00 2001 From: crc Date: Wed, 12 Feb 2020 19:54:14 +0000 Subject: [PATCH] retro.forth: remove a variable from `a:for-each`, use asseembly in the implementation FossilOrigin-Name: 2853b4bba6d2e7b55dc0486af0ffc3188edd1b9f774e67691027c3d6832cca47 --- image/retro.forth | 11 +- ngaImage | Bin 37428 -> 37352 bytes vm/nga-c/retro-image.c | 753 ++++++++++++++++++++--------------------- 3 files changed, 379 insertions(+), 385 deletions(-) diff --git a/image/retro.forth b/image/retro.forth index dba4875..4d3c19d 100644 --- a/image/retro.forth +++ b/image/retro.forth @@ -1354,14 +1354,9 @@ against each value in an array. This is leveraged to implement additional combinators. ~~~ -{{ - 'Q var ----reveal--- - :a:for-each (aq-) - &Q [ !Q fetch-next - [ fetch-next swap [ @Q call ] dip ] times drop - ] v:preserve ; -}} +:a:for-each (aq-) + swap fetch-next &swap dip + [ push fetch-next \swpodupu \swpuca.. \popo.... ] times drop-pair ; ~~~ With this I can easily define `a:dup` to make a copy of an diff --git a/ngaImage b/ngaImage index 5012ee5555b43450ab2ffcaf3624ca7ea78b691e..a858cd45f10aad9a667eb7a245ada8d30fc48737 100644 GIT binary patch delta 2896 zcmaJ@ZERCz6u!6HEi0s(rL0|7x>7pqW*u`wC@^4aHiLr=k!1-GP1w}v5@JBezDL(} zV{A}pbBK}1gaIZdx@65HM!^hX_<^_>V)!vo$P5_3pp2M-3g~lg-&@CAX!7Pf=bYz! zykGb2=O=VGkL!%`3`zP2zjv}FsVQbO7bqv(k~B25py0kDCk;7#`Kydu9Fi1~B&h~t zIhpD_hGZZ)MUs}%So@q3q}T?Eq8TBR^*SY4Ns;t=Nt(%aj5=^Q=oUs&Qrx})wgBbU zd*yvpUGH>pDUBZz{N>=YtseS^&W}PLCR0PH;XC08 z(CZCu`5Ov0Sd~H8u25ftr|>#^xj*g`wI=s)O+;!vaMXl@CK}c(RI=jqD==y6!PtZ} z+7uoq!s)k-7UdSy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