Path: csiph.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Buzz McCool Newsgroups: comp.lang.postscript Subject: Re: Stack Management In GXScript Date: Fri, 3 Jan 2025 08:53:44 -0800 Organization: A noiseless patient Spider Lines: 20 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 03 Jan 2025 17:53:45 +0100 (CET) Injection-Info: dont-email.me; posting-host="ff6c4b84f92706b3788723da2c342717"; logging-data="4173079"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX199rtkQ4zceLgf4+bxB4+eQvUItEaMRxo0=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:yag/8yZVxOStDx5iFn71EmG43AQ= Content-Language: en-US In-Reply-To: Xref: csiph.com comp.lang.postscript:4014 On 12/29/2024 8:49 PM, Lawrence D'Oliveiro wrote: > Programming in stack-based languages is notoriously error-prone: it is way > too easy to lose track of where an operand on the stack came from, and > leave too many or too few operands for an operation. gforth allows the use of "locals" in cases like this: https://gforth.org/manual/Local-Variables-Tutorial.html Of course many on comp.lang.forth believe if you are having trouble keeping track of your stack operands, you should break up your function (aka Forth word) into multiple smaller words. So some say that losing track of stack operands is a Forth language feature that tells you that you are not writing your Forth program correctly. BTW, I really applaud the work you are doing. I would use PostScript more than I already do if it had double precision floating point math capabilities. I've always toyed with the idea of including the math needed to compute an engineering equation and a graph/figure to illustrate it in a single unified program. I haven't pursed it on PostScript because of the precision issue.