HolonJ Forth
Using HolonJ
Clock
Tic Tac Toe

Classes
Methods
Parameter
Variables
Forth
Flow Control
Compiler
Libraries
Constructors
Exception

Methods

Forth words are methods

A Forth word corresponds to a static class method. 

: myword ( -- ) ...  ;

The definer i: creates dynamic instance words, which are related to an object. 

i: start ( -- )  ;

The methods are public by default. You can attach all Java method attributes to HolonJ words. 

private : myword ( -- ) ... ;

Identifiers

The identifier (name) may contain a prefix, which is used by HolonJ but does not appear in the class file. This is necessary because Holon requires unique names. 

Example: The <init> method of the class view is called view.<init> in HolonJ. The method has the name <init> in the class file. <init> is used in other classes as well.

Calling words in other classes of the application (package)

If a word belongs to a different class of the same application, i.e. if the word is in another module in the Holon source browser, HolonJ creates the corresponding external method reference. 

Using Library Methods

Methods in external packages are imported. The external method is then represented by a local word.

next