ANSI Model Forth 
Author Message
 ANSI Model Forth

ANSI.4TH  1.3.1  Revised 7-12-92  J.Peters  Written 12-7-92

                A note to implementors of
                    ANSI MODEL FORTH

and others who will be converting Forth programs to the new standard.

           Please properly factor words when possible...

1) When the word has potiental reuse.
2) When it will make the code more readable.
3) When it will bring the code closer to the problum you are solving.

Don't factor when the additonal name will just clutter up the code,
unless you are planning to go back and lengthen the short words after
the code is working and you will not be typing the names as often as
you do durring developement.

Think of the major task words as little objects that will be reused.
Name them as well as your children.  Name them for life.  Please use a
bit longer names, when it will provide clarity.

Example:

VIEW should be factored so that the  BL WORD  is in the primitive word
(VIEW)  This is so one can tick a word and call (VIEW) and receive the
file name and line number.  Submitted by John A. Peters

Any time a word is created that takes a parameter in line, the
corresponding word should be made which takes the paramater from the
stack.   Paul Snider

Words that embody a loop are a candidate for a named subroutine.

Words that use an IF ELSE THEN or IF THEN construct are posabilities
for named words.

As we begin to see ANS compliant systems in the comming months rember
that we have lots of proir art to draw from.  The following are just
some of the Forth systems that have paved the road for us.

F83  F83x  F83s  F-PC  Pygmy  E-Forth  MVP  SC/Forth J-Forth  FIG
Forth KForth  NGS-Forth  Fifth  LMI-Forth  MMS-Forth  Neon LMI-Forth
PNS-Forth  Lyons-Forth  Thinking Forth  Starting Forth LaForth
79-Forth 83-Forth  77-Forth  Kit Peak Forth  Forth-Inc HS/Forth
Shaboom Bryte-Forth  68000 Forth  Master-Forth  Task-Forth Poly-Forth
Mac-Forth Mach-Forth  Concept-4th  SDS-Forth  MMS-Forth  Cap'n Software
Task Forth Forth-32  Color-Forth  CoCo Forth  SSI Forth Mautilus Forth
Z-80 Forth Marx Forth  Dual-Tasking Forth  RSX-11M Forth  RT-11  CP/M
86 TRS80-Forth  P-Forth  and any others I over looked.

The following words are not in the standard and are candidates for
inclusion in the service domain list of words.   Lets import the best
version from the prior art listed above.

5   'CURSOR         Address of the cursor.
    >LINK           To the link.
    >NAME           To the name field.
    >VIEW           To the view field address.
4   ANY?            Example returns a flag:   Ascii Y  Ascii y  13   3 ANY
5   ASCII           The ascii value of the character.
6   BUG alias DBG   Tick a word and start debugging it immediatly.
6   CAPACITY        The number of lines or blocks in the file.
7   CONSOLE         Vector I/O thru the console.
4   CONVEY          Move a set of screens or lines using TO which sets HOP
8   D*              Double number multiply.
7   D.J             Double number justified on the decimal point.
7   D/              Double number devision  no remainder.
    DARK            Clear the screen.
5   DEFER           Vector a word to be set by resolve later.
3   DO-THRU         ( n n -- )  from  n to n inclusive.  No 1+ swap needed
3   DO-TO           Loop up until the count equals the number on the stack.
9   DOS"            Execute a DOS command and return to Forth.
4   EMPTY           Forget all the words down to where empty was compiled.
7   END?            End compilation if true
5   EOF             End-of-file
8   EXECUTE-IN-FILE A defered word executed on each file called by LOOP-THRU
5   FIND&REPLACE    F&R  (for editing)
7   FK              FK <key> <Forth-word>  Asign the key to the word.
5   FREE            Amount of free dictionary space.
7   FROM            Open the input file.
8   HIT             Execute the line  ( n -- )
7   HLD             Decimal place.
    HOP             Number of screens or lines to hop over via convey
7   HOT-PATCH       Stick a new word in the place of an other word.
6   IND             A smart index that starts at given number or 0 if none given.

    L>NAME          Link to name
    LATEST          Code field address of the latest word compiled.
9   LINE            ( n -- a )  address of line n   (Block or SEQ)
9   LINE-READ       Read a line of text.
    LINK>           To link address
9   LOOP-THRU       Loop thru each file and ececute execute-in-file
    N>LINK          Name to link
    NAME>           To name
6   NUF?       see  START-STOP  for a as it is a bit more user friendly.
10  OBEY            Given  ( adr len -- )  execute the regon. See HIT
6   OK              Load the currently open file.
8   PRINT           Execute the command line with output to the printer
8   PROOF           Execute the command line with output thru PAGINATION

12  REF             List all the words refered to by the word in question.
11  RELOAD          Clean the dictionary and reload the range of lines.
6   RESTORE-ENV     Save the SCR#  R#  >IN  BLK and FILE
6   SAVE-ENV        Restore the above
9   SAVE-SYSTEM     Smart word, chooses between  save-exe  and  save.com
8   SET-PATH        Set the path to the given text string.
14  SCREEN-OUTPUT   Vectors the results of the remainder of the command line
                    to the screen where it can be edited or loaded.
9   START-STOP      CR or SPACE toggles, several CRs or an ESC quits.
8   ~TAB-SIZE        Variable tab size.
    UMD*            Used to build the word  D*  ( d d -- d )
15  VIEW            Locate and view the source for given word
16  VP              View-Previous  Return to the last viewed source place.
14  WANT            Load a named range of lines. (or blocks)

em for life.  Please use a
bit longer names, when it will provide clarity.

Example:



Fri, 30 Dec 1994 12:34:27 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. ANSI Model Forth

2. Mops object model for ANSI Forth

3. Models of iteration in ANSI Common Lisp

4. ANSI Portability and Improved Forth [sorry]

5. ANSI forth standard on line

6. Learning ANSI Forth

7. Starting Forth, ANSI Version

8. A Standard to Teach Forth (was Re: Chuck Moore on ANSI)

9. Evolutionary Forth (was: Chuck Moore on ANSI)

10. A Standard to Teach Forth (was Re: Chuck Moore on ANSI)

11. ANSI compliant Forth for Power Mac?

12. ANSI FORTH specs

 

 
Powered by phpBB® Forum Software