[comp.lang.forth] Search order user interfaces

wmb@MITCH.ENG.SUN.COM (02/13/91)

I hereby propose a "search order user interface" contest.

Background:

Because there is a lot of Forth community support for ALSO/ONLY, it
has remained in ANS Forth.  Because there is a fair amount of opposition
to it, it has been "banished" to the SEARCH ORDER EXT wordset (i.e. the
"extension" portion of the optional SEARCH ORDER wordset), so it is sort
of "doubly optional".

The base portion of the optional SEARCH-ORDER wordset contains a set of
"primitive tools" for constructing run-time search orders.  Those tools are:

        WORDLIST  ( -- wid )
                Creates a new wordlist and returns its "wordlist id" wid.
                You can give it a name with CONSTANT, or you can use
                WORDLIST inside the CREATE portion of a CREATE .. DOES> word.

        FORTH-WORDLIST  ( -- wid )
                Wordlist id for the Forth wordlist.

        GET-ORDER  ( -- widn .. wid1 n )
                Returns the number of wordlists in the current search
                order, and their "wordlist ids".  wid1 is the wordlist
                that is searched Forth.

        SET-ORDER  ( widn .. wid1 n -- )
                Sets the search order so that the n wordlists
                widn .. wid1 will be searched (wid1 first).  If n is
                -1, sets the search order to the implementation-defined
                minimum search order, containing at least these words.

        GET-CURRENT  ( -- wid )
                Returns the wordlist id of the compilation wordlist
                (where new definitions are created).

        SET-CURRENT  ( wid -- )
                Sets the compilation wordlist to the wordlist "wid".

From these primitives, various search order "user interfaces" may be
readily constructed, including ALSO/ONLY,  FIG-Forth, Forth-79, and
polyForth vocabulary mechanisms.

Contest:

Design your own "user interface wordset" (as in ALSO/ONLY) for
specifying search orders.  Hopefully, it should be buildable on
top of GET/SET-ORDER (if not, tell us the crucial deficiency of
GET/SET-ORDER).  Tell us what is good about it.  Convince us that
it is not "brain damaged".

The prize:

There is no prize, other than the chance that other people like it
and will think you are a hot-shot.

Mitch Bradley, wmb@Eng.Sun.COM