[<<][staapl][>>][..]
Mon May 14 19:52:05 EDT 2012

Input stream vs parameter stack

There's always this tension between prefix commands and postfix
commands.  The pain is that moving from prefix (input) to postfix
(parameter stack) reverses order.

I.e.

PRE:   call n fn a1 ... an
POST1:           a1 ... an fn n call
POST2:           an ... a1 fn n call

The order of a1 ... an doesn't matter so much in the last call, so it
can be assumed that the whole command is fully reversed.

So what is the problem I'm solving, really?

Why is this always such a problem in Forth.  Are parsing words really
that essential?  I mean, there is the interplay between RS and DS, but
it seems there's a similar thing going on between the input stream and
DS.  Is Forth really a 3-stack machine, or a 2-stack, 2-stream machine
- console input and threaded code stream, which are also *very*
similar.




[Reply][About]
[<<][staapl][>>][..]