improve gopher client

FossilOrigin-Name: 8ac59488e3628ed48ec0bb2de2ce44c659036c4e8e7d875849f5398a58d93722
This commit is contained in:
crc 2018-08-05 22:56:17 +00:00
parent 93f335be20
commit 311a3c0743
2 changed files with 8 additions and 8 deletions

View file

@ -14,6 +14,7 @@ There is also a `Results` variable which will point to the data set being displa
'GopherData.txt 'GOPHER-DATA s:const 'GopherData.txt 'GOPHER-DATA s:const
#34 'WrapPoint var<n> #34 'WrapPoint var<n>
'Results var 'Results var
'TARGET d:create #1024 #64 * allot
~~~ ~~~
# Download Data # Download Data
@ -22,8 +23,8 @@ Specify a server, a port number, and the initial seletor to fetch.
~~~ ~~~
:grab (sns-) :grab (sns-)
s:empty 'abcd 'ddabc reorder gopher:get &TARGET 'abcd 'dabc reorder gopher:get
drop GOPHER-DATA file:spew ; drop ;
~~~ ~~~
# Indexes # Indexes
@ -95,12 +96,11 @@ And finally, tie everything together. This will display an index.
~~~ ~~~
:display:index (-) :display:index (-)
#0 here GOPHER-DATA file:slurp drop &TARGET ASCII:LF s:tokenize !Results
ASCII:LF s:tokenize !Results
@Results fetch #2 - @Results store @Results fetch #2 - @Results store
@Results #0 @Results
[ over line display nl n:inc ] [ over line display nl n:inc ]
set:for-each drop ; set:for-each drop ;
}} }}
@ -112,7 +112,7 @@ Text files are really easy. We just read the downloaded file into a buffer and d
~~~ ~~~
:display:text (-) :display:text (-)
GOPHER-DATA file:slurp s:put nl ; &TARGET s:put nl ;
~~~ ~~~
# Final Bits # Final Bits
@ -130,7 +130,7 @@ Text files are really easy. We just read the downloaded file into a buffer and d
~~~ ~~~
:home (-) :home (-)
'forthworks.com #70 '/ grab 'forthworks.com #70 '/ grab
$1 display-by-type ; $1 display-by-type ;
~~~ ~~~

View file

@ -67,7 +67,7 @@
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
#define CELL int32_t /* Cell size (32 bit, signed integer */ #define CELL int32_t /* Cell size (32 bit, signed integer */
#define IMAGE_SIZE 524288 * 48 /* Amount of RAM. 12MiB by default. */ #define IMAGE_SIZE 524288 * 24 /* Amount of RAM. 12MiB by default. */
#define ADDRESSES 2048 /* Depth of address stack */ #define ADDRESSES 2048 /* Depth of address stack */
#define STACK_DEPTH 512 /* Depth of data stack */ #define STACK_DEPTH 512 /* Depth of data stack */