www.delorie.com/gnu/docs/gforth/gforth_12.html   search  
 
Buy GNU books!


Gforth Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3. Forth Tutorial

The difference of this chapter from the Introduction (see section 4. An Introduction to ANS Forth) is that this tutorial is more fast-paced, should be used while sitting in front of a computer, and covers much more material, but does not explain how the Forth system works.

This tutorial can be used with any ANS-compliant Forth; any Gforth-specific features are marked as such and you can skip them if you work with another Forth. This tutorial does not explain all features of Forth, just enough to get you started and give you some ideas about the facilities available in Forth. Read the rest of the manual and the standard when you are through this.

The intended way to use this tutorial is that you work through it while sitting in front of the console, take a look at the examples and predict what they will do, then try them out; if the outcome is not as expected, find out why (e.g., by trying out variations of the example), so you understand what's going on. There are also some assignments that you should solve.

This tutorial assumes that you have programmed before and know what, e.g., a loop is.

3.1 Starting Gforth  
3.2 Syntax  
3.3 Crash Course  
3.4 Stack  
3.5 Arithmetics  
3.6 Stack Manipulation  
3.7 Using files for Forth code  
3.8 Comments  
3.9 Colon Definitions  
3.10 Decompilation  
3.11 Stack-Effect Comments  
3.12 Types  
3.13 Factoring  
3.14 Designing the stack effect  
3.15 Local Variables  
3.16 Conditional execution  
3.17 Flags and Comparisons  
3.18 General Loops  
3.19 Counted loops  
3.20 Recursion  
3.21 Leaving definitions or loops  
3.22 Return Stack  
3.23 Memory  
3.24 Characters and Strings  
3.25 Alignment  
3.26 Files  
3.27 Interpretation and Compilation Semantics and Immediacy  
3.28 Execution Tokens  
3.29 Exceptions  
3.30 Defining Words  
3.31 Arrays and Records  
3.32 POSTPONE  
3.33 Literal  
3.34 Advanced macros  
3.35 Compilation Tokens  
3.36 Wordlists and Search Order  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003