[<<][packetforth][>>][..]
Thu Mar 2 15:50:40 EST 2006

immediate words

something to think about.. pf is a hybrid between forth and something like
joy (snarfed in brood/cat). one example:

    (dup) (1) ifte

    if dup else 1 then

there is no real need for many immediate words in pf, because blocks can
be implemented using sublists, and there's the { } local word context.

i know i can forget about making pf clean. it's a practical thing, and
though i like to dwell over theory, i'm a practical person mostly..
there's a lot of different constructs available. there's more than
one way to do it!

see brood/doc/ramblings.txt for more of this

[EDIT: this is actually quite an important example. because of the raw
nature of forth, there is indeed more than one way to do it. using
highlevel functions in things as simple as if..then constructs adds a
lot of possibility for factoring.

: ifte >r >r if rswap then r> rdrop execute ;

this enables things like { 123 } { 456 } ifte, where the XTs generated
by the angle brackets can be reused in other places. i use this
construct a lot in brood, since it's basic there. and grew quite fond
of it. it's cleaner than if-else-then.]



[Reply][About]
[<<][packetforth][>>][..]