Amool data structure ( )

One of the basic things you can do with Amool is to define a hierarchical data structure.
If you're familiar with XML, then you'll see it's pretty much the same thing..

As you already know from the intro, each component in Amool is a class.
A class contains some textual information, plus an optional set of child definitions.

Syntactically, you define a child using the &+ keyword, immediately followed by the name of the child (eg, &+child), and end its definition with the symbol &&

When you take out the child definitions of your Amool code, you get the text content of the class...

A little example:

&+Family
This is my family:
    &+Dad Jack &&
    &+Mum Marja &&
    &+Daughter Ilo &&
    &+Son Max &&
&&

(The dots stand for classes, and dashed arrows for parent-child relationship)

This example defines a class named Family, that has four children Dad, Mum, Daughter and Son, and has as textual contents "This is my family:".
Now, all these four children don't have any children themselves, but contain some text.

Multiple children

You can also define more than one child under the same symbol...

Another little example:

&+Computer
(My Amiga :)
HardDisks:
	&+HardDisk Work
	   &+Size 900M &&
	&&
	&+HardDisk Boot
	   &+Size 50M &&
	&&
Cards...
	&+Card CyberVision 64/3D &&
	&+Card CyberStorm mk3 &&
	&+Card Some audio Card &&
&& 

Now you've got a class named Computer, that has got two children, HardDisk and Card; the first one having two definitions and the second one having three. And then, you can see that each definition of HardDisk has a child named Size.


Maxime Gamboni <> Last compiled : Wed Apr 23 21:53:37 CEST 2003