From 406f184be6450aed529774bc7b82deb4463b3df2 Mon Sep 17 00:00:00 2001 From: crc Date: Tue, 11 Feb 2020 21:32:04 +0000 Subject: [PATCH] retro.forth: more readable a:append FossilOrigin-Name: 2a36f4191177e1e8e7a4519a1bf7b5630eaedc8aae3d070ac0ce8aa2095fd8c0 --- image/retro.forth | 14 ++++++++------ ngaImage | Bin 37844 -> 37844 bytes vm/nga-c/retro-image.c | 10 +++++----- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/image/retro.forth b/image/retro.forth index 8c093d5..e4da62b 100644 --- a/image/retro.forth +++ b/image/retro.forth @@ -1402,13 +1402,15 @@ from one location to another. I then define `a:append` and `a:prepend` to combine arrays. ~~~ -:a:prepend (aa-a) - here #0 , [ dup fetch [ &, a:for-each ] dip - swap dup fetch [ &, a:for-each ] dip + ] dip - &store sip ; +{{ + :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) + swap a:prepend ; +}} ~~~ `a:chop` returns a new array containing all but the last value diff --git a/ngaImage b/ngaImage index d8dd2b03851bfa81e76012890254fc77e2045deb..508c610b514a9820f6d7d9003a8c47ec938a09ec 100644 GIT binary patch delta 115 zcmcbzoaxGPrVS@5SS{rk7$!_UTQ1JW#K6G755$b@3=B?klldy7L~VhRj2sLMRzS=J xl;Q*OLnfcB@K*$hg0!-LG(g#cKsHDfBM`?-o>(c*=stO4r8#5B=9iVPB>@4O6{-LL delta 110 zcmcbzoaxGPrVS@580{u2R{HZYF)%Rj12H2z1B3tMj}_9gUUEPl2Lpo@5VHVfkX6Kj kR7gf3sSpIJ-~#CfVz<{9 diff --git a/vm/nga-c/retro-image.c b/vm/nga-c/retro-image.c index 2cd8804..da6547a 100644 --- a/vm/nga-c/retro-image.c +++ b/vm/nga-c/retro-image.c @@ -389,11 +389,11 @@ CELL ngaImage[] = { 1793,14339,14883,15036,202004,0,10,1,10,2,10,3,10,4,10,5,10, 7649,2049,2106,10,7636,7673,144,97,58,99,111,112,121,0,1,3,1793,7689,4097,3, 2,2049,7504,2049,105,1,105,2049,7601,10,1,7677,2049,3082,10,7663,7709,144,97,58, 116,111,45,115,116,114,105,110,103,0,1,3,1793,7722,2049,7645,1,0,2049,105, - 2049,2883,10,1,7713,2049,3082,2049,3612,10,7694,7742,144,97,58,112,114,101,112,101, - 110,100,0,2049,1877,1,0,2049,105,1793,7779,2,15,1793,7759,1,105,2049,7601,10, - 1,7754,2049,2106,4,2,15,1793,7773,1,105,2049,7601,10,1,7768,2049,2106,17,10, - 1,7750,2049,2106,1,36,2049,2116,10,7729,7800,144,97,58,97,112,112,101,110,100, - 0,4,2049,7742,10,7788,7814,144,97,58,99,104,111,112,0,2049,7645,1,-1,2049, + 2049,2883,10,1,7713,2049,3082,2049,3612,10,7694,7737,144,99,111,112,121,0,2,15, + 1793,7746,1,105,2049,7601,10,1,7741,2049,2106,10,7694,7764,144,97,58,112,114,101, + 112,101,110,100,0,2049,1877,1,0,2049,105,1793,7779,2049,7737,4,2049,7737,17,10, + 1,7772,2049,2106,1,36,2049,2116,10,7751,7800,144,97,58,97,112,112,101,110,100, + 0,4,2049,7764,10,7788,7814,144,97,58,99,104,111,112,0,2049,7645,1,-1,2049, 3063,2,2049,2999,10,7804,7836,144,97,58,102,105,108,116,101,114,0,1793,7851,67502597, 1,21,2049,2106,4,1,105,1,11,2049,64,10,1,7838,2049,7360,2049,1877,1793,7866, 67502597,15,2049,105,2049,7601,10,1,7859,2049,2106,2049,1877,67502597,18,2049,2896,67502597,16,10,