3.5 The SINGULAR language
=========================

SINGULAR interprets commands given interactively on the command
line as well as given in the context of user-defined procedures.  In
fact, SINGULAR makes no distinction between these two cases.
Thus, SINGULAR offers a powerful programming language as well as
an easy-to-use command line interface without differences in syntax or
semantics.

In the following, the basic language concepts such as commands,
expressions, names, objects, etc., are discussed.  See Procedures,
and Libraries,
for the concepts of procedures
and libraries.

In many aspects, the SINGULAR language is similar to the C
programming language.  For a description of some of the subtle
differences, see Major differences to the C programming language.

Elements of the language
........................

The major building blocks of the SINGULAR language  are
expressions, commands, and control structures.  The notion of expressions
in the SINGULAR and the C programming language are identical,
whereas the notion of commands and control structures only roughly
corresponds to the C statements.

* An "expression" is a sequence of operators, functions, and operands
that specifies a computation.  An expression always results in a
value of a specific type.  See Data types, and its subsections (e.g.,
poly expressions), for information on how to build expressions.

* A "command" is either a declaration, an assignment, a call to a
function without return value, or a print command.  For detailed
information, see General command syntax.

* "Control structures" determine the execution sequence of commands.
SINGULAR provides control structures for conditional execution
(if ... else) and iteration (for and
while).  Commands may be grouped in pairs of { }
(curly brackets) to form blocks.  See Control structures, for
more information.

Other notational conventions
............................
For user-defined functions, the notion of "procedure" and
"function" are synonymous.

As already mentioned above, functions without return values are called
commands.  Furthermore, whenever convenient, the term "command" is
used for a function, even if it does return a value.

* General command syntax::
* Special characters::
* Names::
* Objects::
* Type conversion and casting::
* Flow control::

<font size="-1">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; User manual for <a href="http://www.singular.uni-kl.de/"><i>Singular</i></a> version 2-0-4, October 2002,
generated by <a href="http://www.gnu.org/software/texinfo/"><i>texi2html</i></a>.
</font>

</body>
</html>
