|
  
Data Types Overview
DScript supports six basic types of data:
o Numbers
o Text strings
o Boolean values
o Function pointers
o Lists
o Objects
These are the same data types supported by standard
JavaScript. However, DScript extends the definition of a number
to include complex numbers and numbers with units of measure.
Furthermore, DScript extends its treatment of lists and objects
so that they behave exactly like the other, more basic data
types.
Many of the primitives built into DScript can accept a wide
variety of data types as input and will adapt to the data you
provide. For example, the Add
operator (+) in the expression
2+3 // = 5
performs simple numeric addition. However, in the expression
"Hello "+"world"
// = Hello world
the same operator performs text concatenation. Furthermore, in
the expression
[[1,2],[3,4]]+[[6,7],[8,9]] // =
[[7,9],[11,13]]
the Add operator performs
matrix addition.
The following sections describe each of DScripts data types.
More detail on each data type can be found in subsequent
chapters.
|