From 311a3c074369865d4dc14bb6d2a74dc73cce2598 Mon Sep 17 00:00:00 2001 From: crc Date: Sun, 5 Aug 2018 22:56:17 +0000 Subject: [PATCH] improve gopher client FossilOrigin-Name: 8ac59488e3628ed48ec0bb2de2ce44c659036c4e8e7d875849f5398a58d93722 --- example/iOS/GopherClient.forth | 14 +++++++------- interfaces/rre.c | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/example/iOS/GopherClient.forth b/example/iOS/GopherClient.forth index c87602b..0b7a72f 100644 --- a/example/iOS/GopherClient.forth +++ b/example/iOS/GopherClient.forth @@ -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 #34 'WrapPoint var 'Results var +'TARGET d:create #1024 #64 * allot ~~~ # Download Data @@ -22,8 +23,8 @@ Specify a server, a port number, and the initial seletor to fetch. ~~~ :grab (sns-) - s:empty 'abcd 'ddabc reorder gopher:get - drop GOPHER-DATA file:spew ; + &TARGET 'abcd 'dabc reorder gopher:get + drop ; ~~~ # Indexes @@ -95,12 +96,11 @@ And finally, tie everything together. This will display an index. ~~~ :display:index (-) - #0 here GOPHER-DATA file:slurp drop - ASCII:LF s:tokenize !Results + &TARGET ASCII:LF s:tokenize !Results @Results fetch #2 - @Results store - @Results + #0 @Results [ over line display nl n:inc ] 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 (-) - GOPHER-DATA file:slurp s:put nl ; + &TARGET s:put nl ; ~~~ # Final Bits @@ -130,7 +130,7 @@ Text files are really easy. We just read the downloaded file into a buffer and d ~~~ :home (-) - 'forthworks.com #70 '/ grab + 'forthworks.com #70 '/ grab $1 display-by-type ; ~~~ diff --git a/interfaces/rre.c b/interfaces/rre.c index 5f9cc04..b8e628d 100644 --- a/interfaces/rre.c +++ b/interfaces/rre.c @@ -67,7 +67,7 @@ ---------------------------------------------------------------------*/ #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 STACK_DEPTH 512 /* Depth of data stack */