Prev Up Next Index
Go backward to 6.3.2 Constructor Types
Go up to 6.3 Data representation
Go forward to 6.3.4 External Data Representation

6.3.3 Operators

Access to variables can be modified using operators. Each type of variable has its own set of selection and projection operators which can be used to modify the result of accessing a variable of that type. table 6.3.3 lists the types and the operators applicable to them. In the table, operators have the meaning defined by ANSI C except as follows: the array hyperslab operators are as defined by netCDF[4], the string operators are as defined by AWK[2], and the list operators are as defined by Common Lisp[5].

Classes and operators in the DAP.
 

Class Operators
Simple Types
Byte, Int32, UInt32, Float64 < > = != <= >=
String = != ~=
URL *
Compound Types
Array [start:stop] [start:stride:stop]
List length(list), nth(list,n), member(list,elem)
Structure .
Sequence .
Grid [start:stop] [start:stride:stop] .

Two of the operators deserve special note. Individual fields of type constructors may be accessed using the dot (.) operator or the virtual file system syntax. If a structure s has two fields time and temperature, then those fields may be accessed using s.time and s.temperature or as s/time and s/temperature. Also, a special dereferencing *  operator is defined for a URL. This is roughly analogous to the pointer-dereference operator of ANSI C. That is, if the variable my-url is defined as a URL data type, then my-url indicates the string spelling out the URL, and *my-url indicates the actual data indicated by the URL.

More information about variables and operators can be found in the discussion of constraint expressions in Section 4.1.


Tom Sgouros, August 25, 2004

Prev Up Next