Next: , Previous: , Up: Syntax   [Contents][Index]


3.4 Compound Terms

A simple compound term is composed of an atom of the first two forms (an alphanumeric or graphic atom), called the functor, immediately followed (no spaces) by a sequence of zero or more expressions separated by commas, enclosed in a pair of "("..")" parenthesis. For example:

data(jack, 35)
tr(emp(),X/9,tr(L,7,R))
$$(5)

Simple compound terms are typically instances of a structured data type declared in the program where the functor is a constructor for the type. If not, the compound term has default type term, and a warning that it is not a constructor of a defined type is issued in case there has been a spelling error.

A compound term is a simple compound term, or a compound term immediately followed by a sequence of zero or more expressions separated by commas, enclosed in a pair of "("..")" parenthesis. For example:

curry(*)(4)
curryR(child_of)(mary)(P)

Compound terms that are not simple determine the functor of the compound term by a function call which is itself a compound term.