The run-time library


next up previous
Next: Class definitions
Up: An overview of Web-O-Matic and WOM
Previous: Constraints

The run-time library

The WOM language is conceptually very sparse. To the Web author, most of the interesting behaviour lies in the objects provided by the run-time library. These include:

The following example demonstrates some of these classes.

<HTML>
<HEAD><TITLE>Model output</TITLE></HEAD>
<BODY>
<H1>Output</H1>

<WOMForm>
    <Hider h1>
        <Run r program="d:\lg\lg2.exe z %ID %DIR">
    </Hider>
    <Hider h2>
        <File file="d:\lg\output.html">
    </Hider>

    <Submit value="Press to see progress or results">

    <OnSubmit>
    (t) h1~hiding[t] = r~hasFinished[t]
    (t) h2~hiding[t] = not r~hasFinished[t]
    </OnSubmit>
</WOMForm>

</BODY>
</HTML>

This page refers to the built-in classes Hider, Run and File. The page is intended to run the program d:\lg\lg2.exe\, and uses the Run class for this. When an instance of Run is created, it runs the program named in its program attribute, passing the parameters after the program name on the program's command line.

Runs have a hasFinished attribute which is true if the program has finished running, but false otherwise. When a Run is displayed, it shows the progress reports that the program has sent so far - we provide programmers with some Modula library routines for writing these out. Hiders have a hiding attribute, and display their contents (the stuff between <Hider> and </Hider>) unless this is false. The first hider's hiding attribute is constrained by the first equation to be the same as the Run's hasFinished attribute, i.e. it will hide its contents unless the program has finished. So the first Hider will display the program's progress so far, until it finishes.

The second hider works the other way round. File objects have a file attribute, and display the file whose name this holds. This hider is constrained by the second equation: its hiding attribute is true only when the program has finished. So once that has happened, it will display the program's output file.

To summarise, this page starts a program running when it is first created. It contains a form which, when submitted, sends back an updated version of itself. This will display the program's results if they are ready, otherwise the program's progress so far.


next up previous
Next: Class definitions
Up: An overview of Web-O-Matic and WOM
Previous: Constraints



Jocelyn Ireson-Paine
Sat Oct 12 23:35:52 BST 1996