Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Ron Aaron Newsgroups: comp.lang.forth Subject: Re: FP stack Date: Wed, 10 May 2017 11:00:54 +0300 Organization: A noiseless patient Spider Lines: 21 Message-ID: References: <6c191e71-1a1c-4b13-9c92-e82e0c836788@googlegroups.com> <77b0ca53-6bf4-4c73-a426-2504cb959544@googlegroups.com> <3bfb77ae-f710-4c37-8d5f-5d55a6cea02d@googlegroups.com> <2017May8.143500@mips.complang.tuwien.ac.at> <850fb914-4c39-4142-888a-a0871d108b4a@googlegroups.com> <86ae3a80-ffe1-4a25-a727-908f353587d0@googlegroups.com> <6tednSpqKomGXY_EnZ2dnUU7-N1QAAAA@supernews.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Date: Wed, 10 May 2017 07:57:37 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="664f28ed9331b8e70d3dc6904a534d51"; logging-data="15111"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/YIVZK9sOgg1bGefswnFM+" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: Cancel-Lock: sha1:VIf1WkRHNS1r1PeSq3HWp1Bsi3w= Xref: csiph.com comp.lang.forth:58942 On 05/10/17 10:53, Alex wrote: > On 5/10/2017 08:24, Elizabeth D. Rather wrote: >> Ok, I'll bite, how do you know 1. doesn't occupy 4 cells? > d double-cell signed number 2 cells > +d double-cell non-negative number 2 cells > ud double-cell unsigned number 2 cells > d | ud[2] double-cell number 2 cells > xd unspecified cell pair 2 cells IMO, this is one of the weaknesses of ANS Forth. You have to keep track of how many cells your data takes up. Strings can be one or two cells, so can numbers; and, I suppose, other things as well. Wouldn't it have made some sense to make all items take one cell on the stack so that you could just use SWAP without worrying?