If you use Pocket Forth with any regularity I want to hear from you!
I love this little system and have been toying with the idea of starting
a Pocket Forth email list, should there be enough interest. This would be
a place where we can discuss using PF and swap code, etc. PF is a very
versatile system. It is amazing what can be accomplished in 26k of dictionary!
Anyone interested in such a thing?
Also, I have a growing collection of PF code on the web:
http://www.*-*-*.com/
If you have anything you would like to contribute, please feel free to do
so.
Questions? Comments? ("great idea!" "lame idea!", whatever..) to
Ron Kneusel
-----------------------------------------------------------------------
Here's a little something I threw together yesterday which might be
helpful:
\
\ Stacker - Stack manipulator for PF
\
\ RTK, 22-May-96
\
\ Adds complex stack manipulations to Pocket Forth.
\
\ Use: <number of items> -- <new stack arrangement>
\
\ <number of items> = integer, 1 - 8
\ <new stack arrangement> = list of letters, a - h
\ that describe the desired stack arrangement.
\
\ Examples:
\
\ 1 2 3 4 abcd: -- bcda gives 2 3 4 1
\
\ 1 2 3 4 abcd: -- ddccaaa gives 4 4 3 3 1 1 1 (note: "b" dropped)
\
1 constant a: \ constants to make things pretty
2 constant ab: \ really number of stack items to fiddle with
3 constant abc:
4 constant abcd:
5 constant abcde:
6 constant abcdef:
7 constant abcdefg:
8 constant abcdefgh:
CREATE ## 16 allot \ storage for stack values (8 max, could be up to 26)
CREATE #$ 80 allot \ storage for token text
: >list ( a b ... n -- ) \ put stack values in storage, in order
1- 0 swap DO r 2* ## + ! -1 +LOOP ;
\ For now, use this only in a colon definition!!!
: -- ( -- ) \ get a resequence string and compile appropriate words
[ ' >list literal ] compile \ get values
LOOP
; IMMEDIATE