next up previous
Next: Attributes
Up: The WOM language
Previous: An example of WOM --- calculating factorials

Elements that create instances

Most WOM elements correspond to Object Rexx classes. For example, the TextField tag corresponds to a TextField class supplied with the run-time library. When the compiler encounters such an element inside a WOM file, it will generate code to make an instance of that class and add it to a list inside the class the file is compiled into. When that class is asked to emit itself, it will run down this list and ask each element to emit itself.

If any attributes are given with the element, the compiler will generate code to initialise them. The element <TextField size=10 value="0"> would thus be translated into something like

.TextField~new()~~setsize(10)~~setvalue("0")



Jocelyn Ireson-Paine
Fri May 30 14:03:06 BST 1997