theGSman wrote:
programandala.net wrote:
I don't think it would be practical, even feasible. There are many different stack operations you can do, and most of them can be defined using others. The standard operations have names related to their functions, because the functions are simple.
I think that what chitselb means is that every stack manipulation should have a name, not that every conceivable stack manipulation (no matter how rarely used) should be implemented in a Forth system. It is a simple matter to write a CODE word for any manipulation that isn't in your Forth system but is likely to be used a lot in a program. I have often found 2PICK to be such a word.
Yes and your favorites could be kept available in source form.
Quote:
programandala.net wrote:
That's the problem I just mentioned. It would be hard to remember not only which one is `flop` and which one is `flip`, but also what they actually do!
for "flop" I would probably use ROTSWAP if I needed the word or SWAPUNDER if the former name was not descriptive enough.
"flip" would probably sound better as 3REVERSE. (I hope I didn't get "flip" and "flop" mixed up.
)
I believe
FLIP is
ROT SWAP , and I agree,
ROTSWAP is a better name. It has the virtue of telling what it does just like
DUP>R takes the place of
DUP >R .