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


Gforth Manual

[Top] [Contents] [Index] [ ? ]

Footnotes

(1)

However, in 1998 the bar was raised when the major commercial Forth vendors switched to native code compilers.

(2)

i.e. it is stored in the user's home directory.

(3)

This notation is also known as Postfix or RPN (Reverse Polish Notation).

(4)

therefore it's a good idea to avoid ) in word names.

(5)

We can't tell if it found them or not, but assume for now that it did not

(6)

That's not quite true. If you press the up-arrow key on your keyboard you should be able to scroll back to any earlier command, edit it and re-enter it.

(7)

Actually, there are some subtle differences -- see 5.13 The Text Interpreter.

(8)

For example, `/usr/local/share/gforth...'

(9)

It's easy to generate the separate notation from that by just separating the floating-point numbers out: e.g. ( n r1 u r2 -- r3 ) becomes ( n u -- ) ( F: r1 r2 -- r3 ).

(10)

Sometimes, the term dictionary is used to refer to the search data structure embodied in word lists and headers, because it is used for looking up names, just as you would in a conventional dictionary.

(11)

To be precise, they have no interpretation semantics (see section 5.10 Interpretation and Compilation Semantics).

(12)

well, not in a way that is portable.

(13)

Well, often it can be -- but not in a Standard, portable way. It's safer to use a Value (read on).

(14)

Strictly speaking, the mechanism that compile, uses to convert an xt into something in the code area is implementation-dependent. A threaded implementation might spit out the execution token directly whilst another implementation might spit out a native code sequence.

(15)

It is legitimate both to read and write to this data area.

(16)

Exercise: use this example as a starting point for your own implementation of Value and TO -- if you get stuck, investigate the behaviour of ' and ['].

(17)

In standard terminology, "appends to the current definition".

(18)

In standard terminology: The default interpretation semantics are its execution semantics; the default compilation semantics are to append its execution semantics to the execution semantics of the current definition.

(19)

For a more detailed discussion of this topic, see M. Anton Ertl, State-smartness--Why it is Evil and How to Exorcise it, EuroForth '98.

(20)

Depending upon the compilation semantics of the word. If the word has default compilation semantics, the xt will represent compile,. Otherwise (e.g., for immediate words), the xt will represent execute.

(21)

A recent RFI answer requires that compiling words should only be executed in compile state, so this example is not guaranteed to work on all standard systems, but on any decent system it will work.

(22)

This is an expanded version of the material in 4.1 Introducing the Text Interpreter.

(23)

When the text interpreter is processing input from the keyboard, this area of memory is called the terminal input buffer (TIB) and is addressed by the (obsolescent) words TIB and #TIB.

(24)

This happens if the word was defined as COMPILE-ONLY.

(25)

In other words, the text interpreter processes the contents of the input buffer by parsing strings from the parse area until the parse area is empty.

(26)

This is how parsing words work.

(27)

Exercise for the reader: what would happen if the 3 were replaced with 4?

(28)

For example, 0-9 when the number base is decimal or 0-9, A-F when the number base is hexadecimal.

(29)

Some Forth implementations provide a similar scheme by implementing $ etc. as parsing words that process the subsequent number in the input stream and push it onto the stack. For example, see Number Conversion and Literals, by Wil Baden; Forth Dimensions 20(3) pages 26--27. In such implementations, unlike in Gforth, a space is required between the prefix and the number.

(30)

The ANS Forth definition of buffer is intended not to cause disk I/O; if the data associated with the particular block is already stored in a block buffer due to an earlier block command, buffer will return that block buffer and the existing contents of the block will be available. Otherwise, buffer will simply assign a new, empty block buffer for the block.

(31)

In compiler construction terminology, all places dominated by the definition of the local.

(32)

This feature is also known as extended records. It is the main innovation in the Oberon language; in other words, adding this feature to Modula-2 led Wirth to create a new language, write a new compiler etc. Adding this feature to Forth just required a few lines of code.

(33)

Moreover, for any word that calls catch and was defined before loading objects.fs, you have to redefine it like I redefined catch: : catch this >r catch r> to-this ;

(34)

This is Self terminology; in C++ terminology: virtual function table.

(35)

A longer version of this critique can be found in On Standardizing Object-Oriented Forth Extensions (Forth Dimensions, May 1997) by Anton Ertl.

(36)

This isn't portable, because these words emit stuff in data space; it works because Gforth has unified code/data spaces. Assembler isn't likely to be portable anyway.

(37)

In my opinion, though, you should think thrice before using a doubly-linked list (whatever implementation).

(38)

The Unix kernel actually recognises two types of files: executable files and files of data, where the data is processed by an interpreter that is specified on the "interpreter line" -- the first line of the file, starting with the sequence #!. There may be a small limit (e.g., 32) on the number of characters that may be specified on the interpreter line.

(39)

Unfortunately, long longs are not implemented properly on all machines (e.g., on alpha-osf1, long longs are only 64 bits, the same size as longs (and pointers), but they should be twice as long according to see section `Double-Word Integers' in GNU C Manual). So, we had to implement doubles in C after all. Still, on most machines we can use long longs and achieve better performance than with the emulation package.

(40)

We use a one-stack notation, even though we have separate data and floating-point stacks; The separate notation can be generated easily from the unified notation.

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