HANDBOOK
/ GENTLE PRIMER
/ Describing Data
/
Terms
The most important kind of data a Gentle program operates on
are socalled terms.
A term may be a simple constant, as e.g. red or yellow,
or it may be a compound structure, as e.g.
signal(red, yellow). Here, the term is obtained by prefixing
a socalled functor, signal, to two arguments:
red and yellow.
The simple constants are merely functors with no arguments.
Hence, terms are constructed by applying functors to simpler terms.
This can be done to an arbitrary depth of nesting.
A term may be viewed as a linear notation of a tree.
For example,
the term
f( g(a,b), h(c,d) )
may be represented graphically as a tree
f

+g
 
 +a
 
 +b

+h

+c

+d