retroforth/interface/block.retro
crc 7c29018d11 more use of d:set-source instead of raw lookup/patching for initial source data; remove NoEcho variable
FossilOrigin-Name: 6e56f20570a58f1e5a7782f7a26a3cdeaa2af17b6a58f46a63ba509366306ebf
2023-04-12 00:34:17 +00:00

32 lines
717 B
Forth

Blocks allow for a simple storage subsystem. In the smaller ilo
and napia based systems, they are mandatory and are the primary
means of data and code storage
Under RetroForth/nga, this is optional, but is enabled by
default.
The exposed word set is compact:
block:set-file (s-)
block:read (na-)
block:write (na-)
~~~
{{
:block:invoke #3 io:scan-for io:invoke ;
---reveal---
:block:read (na-) #0 block:invoke ;
:block:write (na-) #1 block:invoke ;
:block:set-file (s-) #2 block:invoke ;
}}
~~~
# Source Data
~~~
'interface/blocks.retro s:dedup
dup 'block:read d:lookup d:source store
dup 'block:write d:lookup d:source store
dup 'block:set-file d:lookup d:source store
drop
~~~