Index

function type name(type name, ...) {expression}

Create a new function.

Arguments:
type name
The return datatype and name of the function.
type name, ...
The datatype and name of each argument of the function.
expression
The expression who's value is to be returned by the function.

Example:
The following example declares a function that returns true if a given source is above the 40 degree elevation limit of the CBI telescope but the moon isn't. It then shows how one might use this to wait for a given source to become observable.
 function Boolean observable(Source s) {
   $elevation($s) > 40.0 & $elevation(moon) < 40.0
 }

 until $observable(3c345) & $between(23:34,03:00,LST)
 ...
Context:
User-defined functions are essentially just named expressions.

Martin Shepherd (9-Oct-1997)