Sujet : Re: Avoid treating the stack as an array [Re: "Back & Forth" is back!]
De : albert (at) *nospam* spenarnc.xs4all.nl
Groupes : comp.lang.forthDate : 11. Sep 2024, 12:29:03
Autres entêtes
Organisation : KPN B.V.
Message-ID : <nnd$7461d452$2aea2f75@d13cc4e028e74b2b>
References : 1 2 3 4
User-Agent : trn 4.0-test77 (Sep 1, 2010)
In article <
nnd$545e2daa$4f8af75c@548f76d6156a46d8>,
Hans Bezemer <
the.beez.speaks@gmail.com> wrote:
<SNIP>
Now, I won't say Forth doesn't have its issues. I think IN ESSENCE
recognizers are a beautiful idea. Extend it to strings and you could
eradicate "parsing words" and have something like:
>
"lib/mylib.4th" include
>
"Square" : "the square is:" print dup * cr ;
You have that backward, it must be:
{ "the square is:" print dup * cr } : Square
If there is one thing to preserve in Forth that is the
convention that defining words can parse new names in
the dictionary by forward scanning, without those considered strings.
Here { introduces a denotation, without being a PREFIX (" recognizer"),
such as 0x in 0xDEADBEEF is. It is the same within a definition like
numbers and nowadays strings.
{ "the square is:" print dup * cr } CONSTANT orang_utan
orang_utan DUP : Square : quadrate
>
But okay, we'll do with what we have ;-) And BTW, TURNKEY should be
standard. Clean up the dictionary, pump out an executable.
I have create a language on that principle, e.g. meta
accepts 2 xt's a build and a run one. meta is the mother of
all defining words:
{ , } { @ } meta CONSTANT
{ CELL ALLOT } { } meta VARIABLE
{ 2 CELLS ALLOT } { } meta 2VARIABLE
{ } { EXECUTE } meta :
{ } { } meta DATA \ My favorite.
CREATE DOES> is the right idea, an object with an allocation
part and a behavior, but the syntax is akward beyond despair.
I have a backlog, busy with preserving projects dating from the
80's, so don't expect a publication soon.
>
Hans Bezemer
>
>
-- Temu exploits Christians: (Disclaimer, only 10 apostles)Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style WallArt For Home, Office And Garden Decor - Perfect For Windows, Bars,And Gifts For Friends Family And Colleagues.