Because of the numerous different ways that an omegahat session can be configured, the descriptions below may not apply due to confounding with other options in effect.

This gives a description of the sequence of steps performed when a basic omegahat session is started. We focus here on the standard omegahat session which is created by running the omega class as an application. Other classes can be used as the entry point for he Java Virtual Machine (JVM) via the -i flag of the omegahat script.

The omega application

The application starts by creating an instance of itself, storing the command line arguments both internally and for future reference by other objects in a static field in the Globals class. Then it calls its init() method.

The init() method creates an EvaluatorManager which is used to coordinate (some of) the different Evaluators. It also knows how to create new Evaluator instances. We use this to obtain an initial evaluator. The manager does this by finding the class name for the default evaluators under the property evaluatorClassName. This can be specified as a system level property, in the options file controlling the session, or as a last resort is hard-coded in the Java class.

At this point, we have an evaluator but it has nothing to do. One of the goals of omega is to create highly modifiable and extensible software. In order to keep the environment flexible, the remainder of the initialization is performed by using the omegahat language itself. By default, this is named OmegaInit. It can be located in a variety of different places, e.g. within the omegahat source tree, in the binary Environment.jar file, or a different file can be specified on the command line via the -s argument. In this last example, the script can even be a URL:

  omegahat -s 'http://www.omegahat.org/Scripts/OmegaInit'

The file is handed to the source() method. This can use the manager's FileLocator object to find the file. Additionally it is intended to check whether the string identifies a URL and dispatch a call to the appropriate source() method accordingly.n

Default OmegaInit Script

The default OmegaInit script is quite simple and divided into 3 sections. The first displays a message containing information about the version/release of the software. This is read from the OmegaOptions if possible or else is displayed as unkown.

Next, the script sets the OmegaFinalScript to the name of a file whose contents are evaluated as an Omegahat script when the session is being terminated via the q() method of the standard Evaluator.

.omegahatrc

The next element of the default OmegaInit script is to read the user's own script. By default, this is in the home directory of the user in the file named .omegahatrc. A different file can be specified via the +u flag to the omegahat script.
  omegahat +u /a/b/c
Alternatively, we can avoid reading the user's file via the -u flag. (This takes no following argument.)

This script can contain any legal Omegahat expressions. (Terminate each with a semi-colon.)

One should keep in mind the endSource().

At this point, the script potentially sources two other scripts. The first is a splash screen that displays the Omegahat logo, etc. This is simply a frill and only used to show that something is happening should the user be alarmed by a slow startup time. The display of this window is governed by the presence of the property UseGUI. The second script that is evaluated sets up the prompt.

Prompt and User Input

The prompt is an interesting aspect of the Omegahat system.

OmegaOptions


Duncan Temple Lang <duncan@research.bell-labs.com>
Last modified: Sun Oct 3 18:39:13 EDT 1999