programming tools for Windows applications development
  Home  |   SwiftForth Archive  |   SwiftX Archive  |

Re: some queries

From: Don Groves <groves_at_acm.org>
Date: Sun, 27 Dec 1998 13:55:50 -0800

At 12:26 12/27/98 -0800, Rick wrote:
>Original sender: "Rick VanNorman" <rvn_at_forth.com>
>>Original sender: Don Groves <groves_at_acm.org>
>>
>>I'll jump in on this one. I think !+ means store at the address
>>on the stack and leave an incremented address. So the stack comment
>>would be: ( x addr -- addr+CELLsize). This is the Forth equivalent
>>of the C statement: *p++ = x;
>>
>>Maybe it would be better named !++ ;-)
>
>Don,
>The function is historic in PolyForth and is exactly as I
>described it. This is much more useful for building tables, ie
>
> PAD
> 10 !+
> 12 !+
> 222 !+
> DROP
>
>Otherwise, you would be typing:
>
> PAD
> 10 SWAP !+
> 12 SWAP !+

Rick,

When I answered, your response had not yet been posted and I was assuming
that all !-like words would have the same initial stack setup. Sorry.

I definitely agree that ( addr n) is better than ( n addr) for !+.
However, it also introduces the type of inconsistancy that makes it
easier to make mistakes (IMHO). I suppose it's a little too late to
change ! and +! from ( n addr) to ( addr n) also ;-)

---------------------------
Don Groves
FORTH YOU LOVE IF HONK THEN
---------------------------

.
Received on Sun Dec 27 1998 - 13:55:50 PST

This archive was generated by hypermail 2.2.0 : Thu Nov 20 2008 - 03:04:26 PST