Discussion:
What with `` BL WORD ''
(too old to reply)
a***@spenarnc.xs4all.nl
2024-12-15 14:32:17 UTC
Permalink
Traditionally BL WORD places a word from the input stream,
(terminal input buffer, stream buffer or file buffer)
onto HERE where it can be fetched by $@-BD ( aka COUNT).
Even gforth does this, and undoubtedly many legacy programs
will crash on gforth, if it does behave otherwise.
(Tested on gforth 0.7.3).
[The idea was that it is the name of a colon word, and the
laborious task of copying it from the input buffer should not
be done only once, so the headers were defined such that the name
was in the right place. This dates from the seventies of the last
century.]


Reading iso93 section 3.3.3.6.
A lot of interference can be avoided to define
CREATE PAD ALLOT ALIGN
A permanent region could serve as a transient region, so
from the users of PAD there is no problem.
Common sense dictates that the simultaneous use of PAD for conflicting
purposes should be avoided, as is the same now.

In view of Gigabyte memories, a lot of interference could also be
avoided, if BL WORD were entitled to ALLOT the space.
A permanent region could serve as a transient region, so
from the users of WORD there is no problem.

: WORD WORD DUP COUNT ALLOT ALIGN ; \ Or some such.

Is this in conflict with the standard?


Groetjes Albert
--
Temu exploits Christians: (Disclaimer, only 10 apostles)
Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall
Art For Home, Office And Garden Decor - Perfect For Windows, Bars,
And Gifts For Friends Family And Colleagues.
Anton Ertl
2024-12-15 16:08:33 UTC
Permalink
Post by a***@spenarnc.xs4all.nl
In view of Gigabyte memories, a lot of interference could also be
avoided, if BL WORD were entitled to ALLOT the space.
A permanent region could serve as a transient region, so
from the users of WORD there is no problem.
: WORD WORD DUP COUNT ALLOT ALIGN ; \ Or some such.
Is this in conflict with the standard?
Yes. In

create foo bl word bar drop 1234 ,
foo @ .

the standard specifies that this prints "1234", but with your
redefinition of WORD, it does not.

More formally, the standard specifies that the memory allocated by ,
is contiguous with the data space of FOO, and WORD is not one of the
words that terminates a contiguous region.

- anton
--
M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
New standard: https://forth-standard.org/
EuroForth 2024: https://euro.theforth.net
a***@spenarnc.xs4all.nl
2024-12-16 10:42:44 UTC
Permalink
Post by Anton Ertl
Post by a***@spenarnc.xs4all.nl
In view of Gigabyte memories, a lot of interference could also be
avoided, if BL WORD were entitled to ALLOT the space.
A permanent region could serve as a transient region, so
from the users of WORD there is no problem.
: WORD WORD DUP COUNT ALLOT ALIGN ; \ Or some such.
Is this in conflict with the standard?
Yes. In
create foo bl word bar drop 1234 ,
the standard specifies that this prints "1234", but with your
redefinition of WORD, it does not.
More formally, the standard specifies that the memory allocated by ,
is contiguous with the data space of FOO, and WORD is not one of the
words that terminates a contiguous region.
Thanks. So if you are worried about transient storage interfering with
each other, the solution is to have a static buffer reserved for WORD.
I'll do that.
Post by Anton Ertl
- anton
Groetjes Albert
--
Temu exploits Christians: (Disclaimer, only 10 apostles)
Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall
Art For Home, Office And Garden Decor - Perfect For Windows, Bars,
And Gifts For Friends Family And Colleagues.
Loading...