[comp.lang.forth] Things you can't do in ANS Forth

wmb@MITCH.ENG.SUN.COM (01/26/91)

> BRANCH and ?BRANCH are part of a complex -- the user's ability to to
> add new language features to a Forth system. My concern is with the
> elimination from Forth of this functionality (of which this is the
> latest example).

> I had expected to see some changes in how appliances work -- but not
> an erosion in what could be done in the kitchen. I'm happy that others
> have noticed and I accept Mitch Bradley's assurance that the problem
> will be fixed.

Along these lines, I am trying to make a list of "things you can't do
in ANS Forth", in hopes of fixing them.  Here is my list so far; if
anybody knows of other such "holes", please let me know ASAP so I can
try to get a resolution at next week's meeting.

The current list:

        1) Can't create arbitrary custom control structures (Wil Baden
           has already submitted a proposal to fix this)
        2) A procedure cannot "tick" itself.  (This isn't a serious flaw;
           it is rarely needed, and when you do need it, you can achieve
           the same effect with the equivalent of a "defer" word.  In other
           words, you can look at the problem of ticking yourself as the
           limiting case of a forward reference).
        3) There is no convenient way to compile a string within a
           definition.  There is an inconvenient way: create a string
           containing  " mystring"  (where the quotes are included in the
           string) and EVALUATE it.
        4) You can't reliably POSTPONE "[" and "]" to create words that
           pop back and forth between interpret state and compile state.
           (This has been a problem with Forth for as long as I can
           remember, due to difference in interpreter implementations;
           some implementations use a single loop controlled by the
           variable STATE, and others use separate loops for compiling
           and interpreting).

Please tell me of other "holes" that you know of.  Please try to distinguish
between features that are reasonably portable across most implementations,
and those that are highly implementation-dependent (for example, the ability
to "bit twiddle" the header of a word is implementation dependent).

Any information that you know of about which existing implementations can
support the features you mention would be very helpful, as well.

There are going to be some things that you just won't be able to do
in a portable way, without resort to implementation knowledge, but
perhaps there are a few more portable "entitlements" that we can get in.

Thanks,
Mitch Bradley, wmb@Eng.Sun.COM