retro.forth: more readable a:append

FossilOrigin-Name: 2a36f4191177e1e8e7a4519a1bf7b5630eaedc8aae3d070ac0ce8aa2095fd8c0
This commit is contained in:
crc 2020-02-11 21:32:04 +00:00
parent 237fd4648a
commit 406f184be6
3 changed files with 13 additions and 11 deletions

View file

@ -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

BIN
ngaImage

Binary file not shown.

View file

@ -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,