|
  
Primitives
DScript's intrinsic functions are called primitives.
These are functions that perform basic tasks such as adding
numbers, reading files, etc. Primitives also perform complex
tasks such as solving numeric integration and linear optimization
problems. Primitives are, more properly, the basic building
blocks you use to build applications.
There are two types of primitives, operators and functions.
Operators are accessed using symbols. For example, the plus
symbol (+) is used to add numbers in an expression such as 2+3. Functions are accessed using the
function name followed by a list of arguments in parentheses. For
example, the expression sqrt(4)
calls the square root primitive.
Operators differ from other primitives only in the syntax used
to access them. In fact, the expression 2+3
is converted to the internal expression _ADD(2,3)
before it is executed. Using the plus symbol to represent the _ADD
primitive just makes accessing the primitive more convenient.
|