From e31cc826566826b48fa0970d5d14333d37746136 Mon Sep 17 00:00:00 2001 From: crc Date: Thu, 31 Dec 2020 15:04:06 +0000 Subject: [PATCH] remove deprecated words FossilOrigin-Name: e999bdb76459148c72894cde22abd88422e5b79fb822fbd83d037892c4c232b0 --- Makefile | 6 ++- doc/Glossary-Concise.txt | 9 ----- doc/Glossary-Names-and-Stack.txt | 3 -- doc/Glossary.html | 21 ---------- doc/Glossary.txt | 33 ---------------- doc/words.tsv | 3 -- example/palindromic-numbers.retro | 4 +- package/extensions/README.retro | 5 ++- package/list.forth | 25 ++++++++++-- .../compat-2020.10.retro} | 0 vm/nga-c/retro-image.c | 39 ++++++++++++++++--- 11 files changed, 65 insertions(+), 83 deletions(-) rename package/{compat.retro => unsupported/compat-2020.10.retro} (100%) diff --git a/Makefile b/Makefile index 6587c19..9eca302 100644 --- a/Makefile +++ b/Makefile @@ -123,14 +123,16 @@ bin/retro-repl: vm/nga-c/repl.c vm/nga-c/image.c # retro on unix +update-extensions: bin/retro + cd package/extensions && ../../bin/retro -f ../../tools/generate-extensions-list.retro >../load-extensions.retro + vm/nga-c/retro-image.c: ngaImage bin/retro-embedimage bin/retro-extend interface/filesystem.retro interface/floatingpoint.retro interface/unix.retro interface/rng.retro interface/sockets.retro interface/scripting.retro interface/retro-unix.retro interface/clock.retro cp ngaImage rre.image ./bin/retro-extend rre.image interface/scripting.retro interface/filesystem.retro interface/floatingpoint.retro interface/unix.retro interface/rng.retro interface/sockets.retro interface/scripting.retro interface/retro-unix.retro interface/clock.retro ./bin/retro-embedimage rre.image >vm/nga-c/retro-image.c -bin/retro: vm/nga-c/retro-image.c vm/nga-c/retro-unix.c vm/nga-c/bsd-strl.c vm/nga-c/config.h vm/nga-c/dev-clock.c vm/nga-c/dev-files.c vm/nga-c/dev-floatingpoint.c vm/nga-c/dev-image.c vm/nga-c/dev-rng.c vm/nga-c/dev-sockets.c vm/nga-c/dev-unix.c vm/nga-c/prototypes.h +bin/retro: vm/nga-c/retro-image.c vm/nga-c/retro-unix.c vm/nga-c/bsd-strl.c vm/nga-c/config.h vm/nga-c/dev-clock.c vm/nga-c/dev-files.c vm/nga-c/dev-floatingpoint.c vm/nga-c/dev-image.c vm/nga-c/dev-rng.c vm/nga-c/dev-sockets.c vm/nga-c/dev-unix.c vm/nga-c/prototypes.h package/list.forth package/load-extensions.retro cd vm/nga-c && $(CC) $(OPTIONS) $(CFLAGS) $(LDFLAGS) -o ../../bin/retro retro-unix.c $(LIBM) - cd package/extensions && ../../bin/retro -f ../../tools/generate-extensions-list.retro >../load-extensions.retro cd package && ../bin/retro -f list.forth ./bin/retro-embedimage rre.image >vm/nga-c/retro-image.c rm rre.image diff --git a/doc/Glossary-Concise.txt b/doc/Glossary-Concise.txt index c21e252..f246fb7 100644 --- a/doc/Glossary-Concise.txt +++ b/doc/Glossary-Concise.txt @@ -1372,15 +1372,6 @@ Store a value into the specified address and return the next address. swap D: nm-mn A: - F: - Exchange the position of the top two items on the stack -sys:argc D: -n A: - F: - -Return the number of arguments passed to the program. Deprecated. Use script:arguments - -sys:argv D: n-s A: - F: - -Given an argument number, return the argument as a string. Deprecated. Use script:get-argument instead. - -sys:name D: -s A: - F: - -Return the filename of the program being run. Deprecated. Use script:name instead. - tab D: - A: - F: - Display a tab (`ASCII:HT`) diff --git a/doc/Glossary-Names-and-Stack.txt b/doc/Glossary-Names-and-Stack.txt index 0980a39..b9277bf 100644 --- a/doc/Glossary-Names-and-Stack.txt +++ b/doc/Glossary-Names-and-Stack.txt @@ -456,9 +456,6 @@ sp D: - A: - F: - store D: na- A: - F: - store-next D: na-a A: - F: - swap D: nm-mn A: - F: - -sys:argc D: -n A: - F: - -sys:argv D: n-s A: - F: - -sys:name D: -s A: - F: - tab D: - A: - F: - times D: nq- A: - F: - tri D: xqqq-? A: - F: - diff --git a/doc/Glossary.html b/doc/Glossary.html index 3e65e13..6afe090 100644 --- a/doc/Glossary.html +++ b/doc/Glossary.html @@ -3517,27 +3517,6 @@

Exchange the position of the top two items on the stack

Class: class:primitive
Namespace: global
Interface Layer: all

-

sys:argc

-

Data: -n
-Addr: -
-Float: -

-
-

Return the number of arguments passed to the program. Deprecated. Use script:arguments

-
Class: class:word
Namespace: sys
Interface Layer: rre

-

sys:argv

-

Data: n-s
-Addr: -
-Float: -

-
-

Given an argument number, return the argument as a string. Deprecated. Use script:get-argument instead.

-
Class: class:word
Namespace: sys
Interface Layer: rre

-

sys:name

-

Data: -s
-Addr: -
-Float: -

-
-

Return the filename of the program being run. Deprecated. Use script:name instead.

-
Class: class:word
Namespace: sys
Interface Layer: rre

tab

Data: -
Addr: -
diff --git a/doc/Glossary.txt b/doc/Glossary.txt index 08f7d52..2bc3afb 100644 --- a/doc/Glossary.txt +++ b/doc/Glossary.txt @@ -5398,39 +5398,6 @@ Exchange the position of the top two items on the stack Class: class:primitive | Namespace: global | Interface Layer: all ------------------------------------------------------------------------ -sys:argc - - Data: -n - Addr: - - Float: - - -Return the number of arguments passed to the program. Deprecated. Use script:arguments - -Class: class:word | Namespace: sys | Interface Layer: rre ------------------------------------------------------------------------- - -sys:argv - - Data: n-s - Addr: - - Float: - - -Given an argument number, return the argument as a string. Deprecated. Use script:get-argument instead. - -Class: class:word | Namespace: sys | Interface Layer: rre ------------------------------------------------------------------------- - -sys:name - - Data: -s - Addr: - - Float: - - -Return the filename of the program being run. Deprecated. Use script:name instead. - -Class: class:word | Namespace: sys | Interface Layer: rre ------------------------------------------------------------------------- - tab Data: - diff --git a/doc/words.tsv b/doc/words.tsv index 4459ce9..d94c9ad 100644 --- a/doc/words.tsv +++ b/doc/words.tsv @@ -456,9 +456,6 @@ sp - - - Display a space (`ASCII:SPACE`) class:word :spaces (n-) [ sp ] t store na- - - Store a value into the specified address. class:primitive 'Base var\n #10 &Base store {n/a} global all store-next na-a - - Store a value into the specified address and return the next address. class:word {n/a} {n/a} global all swap nm-mn - - Exchange the position of the top two items on the stack class:primitive {n/a} {n/a} global all -sys:argc -n - - Return the number of arguments passed to the program. Deprecated. Use script:arguments class:word {n/a} {n/a} sys rre -sys:argv n-s - - Given an argument number, return the argument as a string. Deprecated. Use script:get-argument instead. class:word {n/a} {n/a} sys rre -sys:name -s - - Return the filename of the program being run. Deprecated. Use script:name instead. class:word {n/a} {n/a} sys rre tab - - - Display a tab (`ASCII:HT`) class:word {n/a} {n/a} global all times nq- - - Run the specified quote the specified number of times. class:word #12 [ $- c:put ] times {n/a} global all tri xqqq-? - - Apply q1 against x, then q2 against a copy of x, and finally q3 against another copy of x. class:word {n/a} {n/a} global all diff --git a/example/palindromic-numbers.retro b/example/palindromic-numbers.retro index 1bb91b2..94a4465 100644 --- a/example/palindromic-numbers.retro +++ b/example/palindromic-numbers.retro @@ -14,7 +14,7 @@ Well this is really easy. I begin by creating an array of potential values. ~~~ #100000 [ I n:inc , ] -'Potentials d:create over , times +'Potentials d:create over , indexed-times ~~~ Then a simple `palindrome?` word to convert the number to a string and return a flag indicating if it's a palindrome. @@ -49,6 +49,6 @@ In my tests, this isn't memory efficient, as I'm keeping both the list of potent :value I n:inc dup ; :process [ n:put nl ] &drop choose ; - #100000 [ value palindrome? process ] times + #100000 [ value palindrome? process ] indexed-times This only uses 74 memory locations. diff --git a/package/extensions/README.retro b/package/extensions/README.retro index ab459a0..03283f2 100644 --- a/package/extensions/README.retro +++ b/package/extensions/README.retro @@ -1,6 +1,7 @@ -Put extensions into this directory. When rebuilding via: +Put extensions into this directory and run: - make clean; make + make update-extensions + make Any extensions here will be placed in a file named `package/load-extensions.retro` for compilation into the diff --git a/package/list.forth b/package/list.forth index 89f6553..a7ecaf2 100644 --- a/package/list.forth +++ b/package/list.forth @@ -1,3 +1,12 @@ +# Custom Extensions + +This is a system for allowing you to easily add your own +extensions to RETRO on Unix systems. + +There are two options: + +## Manual Additions + Add files to include to the code block below. Use a form like: @@ -11,14 +20,24 @@ also use any Retro code directly. 'dict-words-listing.forth include ~~~ -~~~ -'compat.retro include -~~~ +## Automatic Extensions + +This does not require manual editing of this file. To use +this: + +- copy (or symlink) the extensions into the `extensions` subdirectory +- run `make update-extensions` +- run `make` + +This will build RETRO, generate a new `load-extensions.retro` and +then rebuild, including the extensions. ~~~ 'load-extensions.retro include ~~~ +## Final Bits + Save the image with anything loaded here added in. The `retro` binary will be rebuilt using the extended image. diff --git a/package/compat.retro b/package/unsupported/compat-2020.10.retro similarity index 100% rename from package/compat.retro rename to package/unsupported/compat-2020.10.retro diff --git a/vm/nga-c/retro-image.c b/vm/nga-c/retro-image.c index 3883376..990c953 100644 --- a/vm/nga-c/retro-image.c +++ b/vm/nga-c/retro-image.c @@ -2,8 +2,8 @@ #ifndef CELL #define CELL int32_t #endif -CELL ngaImageCells = 15393; -CELL ngaImage[] = { 1793,14768,15377,15392,202101,0,10,1,10,2,10,3,10,4,10,5,10,6,10, +CELL ngaImageCells = 15966; +CELL ngaImage[] = { 1793,14768,15923,15965,202101,0,10,1,10,2,10,3,10,4,10,5,10,6,10, 7,10,8,10,9,10,10,11,10,12,10,13,10,14,10,15,10,16,10,17, 10,18,10,19,10,20,10,21,10,22,10,23,10,24,10,25,10,68223234,1,2575, 85000450,1,656912,141,140,268505089,63,62,285281281,0,63,2063,10,101384453,0,9,10,2049,56,25, @@ -160,7 +160,7 @@ CELL ngaImage[] = { 1793,14768,15377,15392,202101,0,10,1,10,2,10,3,10,4,10,5,10, 983556,1793,3087,1,21,2049,2100,10,1,3082,2049,2100,4100,10,3065,3105,146,118,58,117, 112,100,97,116,101,0,4,1793,3112,15,4,8,10,1,3108,2049,2110,16,10,3093, 3126,146,99,111,112,121,0,1793,3135,285278725,1,33951492,268767489,1,6,10,1,3128,2049,2275, - 771,10,3118,3154,146,83,99,111,112,101,76,105,115,116,0,15211,15263,10,3141,3163, + 771,10,3118,3154,146,83,99,111,112,101,76,105,115,116,0,15829,15881,10,3141,3163, 146,123,123,0,2049,1570,2,1,3154,2049,59,16,10,3157,3188,146,45,45,45,114, 101,118,101,97,108,45,45,45,0,2049,1570,1,3154,2049,2890,16,10,3172,3202,146, 125,125,0,1,3154,2049,56,4,15,11,1793,3216,3841,3154,4097,2,10,1,3211,1793, @@ -179,7 +179,7 @@ CELL ngaImage[] = { 1793,14768,15377,15392,202101,0,10,1,10,2,10,3,10,4,10,5,10, 21,2049,2100,4097,3256,10,1,3458,2049,2100,4097,3265,10,3433,3487,133,84,101,109,112, 83,116,114,105,110,103,115,0,32,3472,3505,133,84,101,109,112,83,116,114,105, 110,103,77,97,120,0,512,3488,3517,146,83,84,82,73,78,71,83,0,2049,1543, - 3841,3487,3841,3505,19,18,10,3506,3537,133,67,117,114,114,101,110,116,0,20,10, + 3841,3487,3841,3505,19,18,10,3506,3537,133,67,117,114,114,101,110,116,0,16,10, 3526,3552,146,115,58,112,111,105,110,116,101,114,0,3841,3537,3841,3505,19,2049,3517, 17,10,3539,3571,146,115,58,110,101,120,116,0,1,3537,2049,2988,3841,3537,3841,3487, 11,1793,3587,1,0,4097,3537,10,1,3582,9,10,3506,3601,146,115,58,116,101,109, @@ -772,4 +772,33 @@ CELL ngaImage[] = { 1793,14768,15377,15392,202101,0,10,1,10,2,10,3,10,4,10,5,10, 105,110,110,105,110,103,45,119,105,116,104,0,2049,1874,2049,4648,1793,15342,2049,164, 2049,15282,10,1,15337,2049,7454,10,15305,15359,146,115,121,115,58,97,114,103,99,0, 2049,13691,10,15347,15374,146,115,121,115,58,97,114,103,118,0,2049,13723,10,15362,15389, - 146,115,121,115,58,110,97,109,101,0,2049,13770,10,0 }; + 146,115,121,115,58,110,97,109,101,0,2049,13770,10,15377,15403,146,100,58,119,111, + 114,100,115,0,1793,15412,2049,164,2049,9248,2049,9222,10,1,15405,2049,7454,10,15392,15433, + 146,100,58,119,111,114,100,115,45,119,105,116,104,0,2049,1874,2049,4648,1793,15464, + 2049,164,2,2049,1874,2049,4162,1793,15453,2049,9248,2049,9222,10,1,15448,1793,15459,3,10, + 1,15457,2049,64,10,1,15439,2049,7454,10,15417,15488,146,100,105,115,112,108,97,121, + 45,105,102,45,108,101,102,116,0,2,2049,1874,2049,4598,1793,15500,2049,9248,2049,9222, + 10,1,15495,1793,15506,3,10,1,15504,2049,64,10,15417,15537,146,100,58,119,111,114, + 100,115,45,98,101,103,105,110,110,105,110,103,45,119,105,116,104,0,2049,1874, + 2049,4648,1793,15548,2049,164,2049,15488,10,1,15543,2049,7454,10,15511,15565,146,115,121,115, + 58,97,114,103,99,0,2049,13691,10,15553,15580,146,115,121,115,58,97,114,103,118, + 0,2049,13723,10,15568,15595,146,115,121,115,58,110,97,109,101,0,2049,13770,10,15583, + 15609,146,100,58,119,111,114,100,115,0,1793,15618,2049,164,2049,9248,2049,9222,10,1, + 15611,2049,7454,10,15598,15639,146,100,58,119,111,114,100,115,45,119,105,116,104,0, + 2049,1874,2049,4648,1793,15670,2049,164,2,2049,1874,2049,4162,1793,15659,2049,9248,2049,9222,10, + 1,15654,1793,15665,3,10,1,15663,2049,64,10,1,15645,2049,7454,10,15623,15694,146,100, + 105,115,112,108,97,121,45,105,102,45,108,101,102,116,0,2,2049,1874,2049,4598, + 1793,15706,2049,9248,2049,9222,10,1,15701,1793,15712,3,10,1,15710,2049,64,10,15623,15743, + 146,100,58,119,111,114,100,115,45,98,101,103,105,110,110,105,110,103,45,119, + 105,116,104,0,2049,1874,2049,4648,1793,15754,2049,164,2049,15694,10,1,15749,2049,7454,10, + 15717,15771,146,115,121,115,58,97,114,103,99,0,2049,13691,10,15759,15786,146,115,121, + 115,58,97,114,103,118,0,2049,13723,10,15774,15801,146,115,121,115,58,110,97,109, + 101,0,2049,13770,10,15789,15815,146,100,58,119,111,114,100,115,0,1793,15824,2049,164, + 2049,9248,2049,9222,10,1,15817,2049,7454,10,15804,15845,146,100,58,119,111,114,100,115, + 45,119,105,116,104,0,2049,1874,2049,4648,1793,15876,2049,164,2,2049,1874,2049,4162,1793, + 15865,2049,9248,2049,9222,10,1,15860,1793,15871,3,10,1,15869,2049,64,10,1,15851,2049, + 7454,10,15829,15900,146,100,105,115,112,108,97,121,45,105,102,45,108,101,102,116, + 0,2,2049,1874,2049,4598,1793,15912,2049,9248,2049,9222,10,1,15907,1793,15918,3,10,1, + 15916,2049,64,10,15829,15949,146,100,58,119,111,114,100,115,45,98,101,103,105,110, + 110,105,110,103,45,119,105,116,104,0,2049,1874,2049,4648,1793,15960,2049,164,2049,15900, + 10,1,15955,2049,7454,10,0 };