local function

In Deriscope terminology, a local function is a special type of
Deriscope Function that is similar to the non-static member functions in object oriented programming languages, such as C++.
Like any Deriscope Function it is defined within the scope of a certain
Deriscope Type, but it has the additional feature that it must be invoked by a specific Deriscope Object of that Deriscope Type.

In the spreadsheet a local function named MyFunction defined within a Deriscope Type named MyType and invoked by an Deriscope Object identified through the
handle name named MyHandle may be called using either the full syntax:


or the short syntax:


, where ... stand for any additional arguments that carry the input - if any - required by MyFunction.

For convenience, a local function may be also called as if it were a
static function, thus calling it using the name of the Deriscope Type in which that Deriscope Function is defined, but passing the still required object as an extra argument through a specialized key named THIS.

The following example demonstrates the above concepts:

The Deriscope Function
Maturity is a local function defined within the Deriscope Type Bond that takes no input arguments and returns the maturity date of the invoking Bond Deriscope Object.
Provided the invoking bond Deriscope Object is referred in spreadsheet through the handle name named MyHandle, the local function can be accessed in the spreadsheet using the full syntax:


or the short syntax:


The alternative static short syntax version will look like: