| |
|
| \ I think I avoid the assumption 1 char = 1 here, but I have not tested this |
\ I think I avoid the assumption 1 char = 1 here, but I have not tested this |
| |
|
| 1024 constant chars/block \ mandated by the standard |
\ 1024 constant chars/block \ mandated by the standard |
| |
|
| create block-buffer chars/block chars allot |
create block-buffer chars/block chars allot |
| |
|
| \ reading in the block is unnecessary, but simpler |
\ reading in the block is unnecessary, but simpler |
| block ; |
block ; |
| |
|
| variable scr 0 scr ! \ !! this should be a user var |
User scr 0 scr ! |
| |
|
| : list ( u -- ) |
: list ( u -- ) |
| \ calling block again and again looks inefficient but is necessary |
\ calling block again and again looks inefficient but is necessary |
| scr @ block i 64 * chars + 64 type cr |
scr @ block i 64 * chars + 64 type cr |
| loop ; |
loop ; |
| |
|
| |
: (source) ( -- addr len ) |
| |
blk @ ?dup |
| |
IF block chars/block |
| |
ELSE tib #tib @ |
| |
THEN ; |
| |
|
| |
' (source) IS source |
| |
|
| |
: load ( i*x n -- j*x ) |
| |
push-file |
| |
dup loadline ! blk ! >in off ( ['] ) interpret ( catch ) |
| |
pop-file ( throw ) ; |
| |
|
| \ not yet implemented (with block semantics): |
: thru ( i*x n1 n2 -- j*x ) |
| |
1+ swap 0 ?DO I load LOOP ; |
| |
|
| \ evaluate |
: +load ( i*x n -- j*x ) blk @ + load ; |
| \ load |
|
| \ refill |
: +thru ( i*x n1 n2 -- j*x ) |
| \ thru |
1+ swap 0 ?DO I +load LOOP ; |
| \ \ |
|