lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Tue, 2005-02-01 at 05:15, David Olofson wrote:
> On Monday 31 January 2005 17.15, Mark Hamburg wrote:
> > Not applicable to Lua without whacking pretty much everything, but
> > Forth is very interesting 

> That means operations and operands are inherently lists, rather than 
> trees? 

Forth is Lisp backwards. It uses reverse polish 
(postfix) notation:

	1 2 add   -- forth
	1 + 2     -- C
	(add 1 2) -- Lisp

This means the grammar of Forth, like Lisp, is very simple:

	word = word *

is the whole of it. This has the property that for any
sequence of words  you can define a subroutine, 
and replace the sequence by the subroutine.

Note Forth is heavily used today..  Postscript IS forth.

The forth execution model is also very simple:

(a) if it is a number, push it onto the stack
(b) otherwise execute it



-- 
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net