Hi,
I'm relatively new to Forth and I'm wondering if I'm doing something wrong or
if this is intended behavior or if this is a bug. I'm using gforth on GNU/Linux.
Executing the following gives me an error message and creates an empty 0 byte
file called blocks.fb:
s" Hello world!" 0 block place update save-buffers bye
I have attached the backtrace but it doesn't seem very helpful, all it says is
invalid memory address. So I then delete the file blocks.fb and try again, but
this time with block 1 instead:
s" Hello world!" 1 block place update save-buffers bye
and it successfully writes into the block and we can verify that it did indeed
write into it by starting gforth again and executing:
1 block count type Hello world! ok
So maybe block 0 will work now? I try to write into it again:
s" weird..." 0 block place update save-buffers bye
No errors this time, but when I start gforth again and try to read from it I
don't get the expected output:
0 block count type ok
So I looked at the blocks.fb file in a text editor and "weird..." was written
into it correctly and after a while I've figured that the following works after starting
gforth again:
1 block drop 0 block count type weird... ok
To me this seems like a bug where "0 block" doesn't initialize something that "1
block" does. Either that or I'm using blocks the wrong way. Unfortunately I could not find any
simple examples on how to use blocks so I'm just going off the docs and a few scraps of information
on the internet that I could find.
Best Regards,
shtps