Sujet : Re: Stack vs stackless operation
De : the.beez.speaks (at) *nospam* gmail.com (Hans Bezemer)
Groupes : comp.lang.forthDate : 26. Feb 2025, 11:45:52
Autres entêtes
Organisation : KPN B.V.
Message-ID : <nnd$3d044482$6ea6fd8b@3177f64b4f01bd4d>
References : 1 2 3
User-Agent : Mozilla Thunderbird
On 25-02-2025 21:57, LIT wrote:
Forgive me for being contrary, but IMHO use of locals
is much more C-ish than the use of "as many as" three
(OMG!) variables in a single program. ;)
The goal is to use as few variables as possible. There are plenty of words I wrote using NO variables at all. Arrays (and strings) are another story, since it's hard to represent them using a stack (unless you dump every single element there - which is not realistic).
If I apply that rule, I wrote an entire 1000+ line BASIC interpreter using *three* variables (stack frame pointer, partition pointer and a counter on the number of currently emitted characters on a line - TAB() remember?).
So yeah, three variables is quite a lot. It's should be rare enough not to worry about too much - let alone require special facilities to accommodate such a construct.
Hans Bezemer