The Forth commandments (comedy)

Topics relating to various Forth models on the 6502, 65816, and related microprocessors and microcontrollers.
Post Reply
User avatar
dclxvi
Posts: 362
Joined: 11 Mar 2004

The Forth commandments (comedy)

Post by dclxvi »

Back in the day, I ordered a disk from one of the Apple II public domain distributors. On side 1 is 1978 6502 FIG-Forth. On side 2 is a Forth tutorial which contains this all-time gem:

Code: Select all

SCR # 95
 0 FRAME #86 THE FORTH COMMANDMENTS                                
 1  1. I AM THY 'WORD', THOU SHALT SEPARATE ME BY SPACES.          
 2  2. THOU SHALT NOT TAKE NAMED VARIABLES AND CONSTANTS IN VAIN.  
 3  3. REMEMBER TO KEEP HOLY THY NESTING STRUCTURE, NESTING        
 4     COMPLETELY ONE INTO THE OTHER.                              
 5  4. HONOR THY 'IF' WITH A 'THEN'.                               
 6  5. THOU SHALT NOT KILL THY STACK, BY TAKING OFF MORE THAN THOU 
 7     PUT ON.                                                     
 8  6. THOU SHALT NOT COMMIT ADULTERATED ERRORS, BY USING COMPILING
 9     WORDS OUTSIDE A DEFINITION.                                 
10  7. THOU SHALT NOT STEAL AN UNTESTED ROUTINE INTO A LOOP.       
11  8. THOU SHALT NOT BEAR FALSE WITNESS, BY USING A 'WORD' BEFORE 
12     IT IS DEFINED.                                              
13  9. THOU SHALT COVET 'BEGIN...UNTIL' AND 'LOOP' TO EXECUTE AT   
14     LEAST ONCE.                                                 
15 10. THOU SHALT COVET A SCREEN WITH 'FLUSH'. 'GO' SPREAD WORD.   
And the translation:

Code: Select all

SCR # 96
 0 FRAME #87 SUMMARY OF FORTH RULES                                
 1                                                                 
 2  1. ALL FORTH WORDS MUST BE SEPARATED BY AT LEAST ONE SPACE.    
 3  2. ALL WORDS MUST BE DEFINED BEFORE THEY CAN BE USED.          
 4  3. COMPILING WORDS MUST NEVER BY USED OUTSIDE A DEFINITION.    
 5  4. 'IF' MUST BE BALANCED BY A 'THEN'.                          
 6  5. WHEN USING THE STACK, REMEMBER LIFO (LAST IN FIRST OUT).    
 7  6. WHEN 'NEST'ING, YOU MUST NEST EACH STRUCTURE COMPLETELY     
 8     WITHIN AN OUTER STRUCTURE.                                  
 9  7. NEVER PUT AN UNTESTED ROUTINE INTO A 'LOOP'.                
10  8. USE 'VARIABLES' & 'CONSTANTS' WITH CARE.                    
11  9. REMEMBER THAT ALL 'BEGIN...UNTIL' & 'LOOP' STRUCTURES       
12     EXECUTE AT LEAST ONCE.                                      
13 10. REMEMBER TO SAVE YOUR SCREEN WITH A 'FLUSH'.                
14                                                                 
15     LET'S 'GO' WRITE A PROGRAM!                                 
agsb
Posts: 31
Joined: 09 Jan 2023

Re: The Forth commandments (comedy)

Post by agsb »

Those are serious
barnacle
Posts: 1831
Joined: 19 Jan 2004
Location: Potsdam, DE
Contact:

Re: The Forth commandments (comedy)

Post by barnacle »

I have a vague memory of FigForth having one of its error messages as 'An obscure error of the fifth kind has occurred' but with nothing in the code actually calling it... but it's been a long long time.
Post Reply