Go to Deriscope's documentation start page

static_function

In Deriscope terminology, a static function is a special type of function that is similar to the static member functions in object oriented programming languages, such as C++.
Like any function it is defined within the scope of a certain
Deriscope Type, but it has the additional feature that it does not require the existence of any Deriscope Object of that or any other Deriscope Type.

In the spreadsheet a static function named MyFunction defined within a Deriscope Type named MyType may be called using either the full syntax:

ds("TYPE=","MyType","FUNCTION=","MyFunction",...)

or the short syntax:

ds(("MyType::MyFunction",...)

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

Just like in most object oriented programming languages, a static function may be also called using an existing Deriscope Object that is of the same Deriscope Type in which that function is defined, without a direct invocation of the encompassing Deriscope Type.

In the spreadsheet this is achieved by treating the given static function as if it were a
local function and using the syntax appropriate for local functions.

The following example demonstrates the above concepts:

The function
Calendar::List Calendars is a static function defined within the Deriscope Type Calendar that takes no input arguments and returns the list of all available calendar codes.
It can be accessed in the spreadsheet using the full syntax:

ds("TYPE=","Calendar","FUNCTION=","List Calendars")

or the short syntax:

ds(("Calendar::List Calendars")

Provided the existence of an object of type MyType referred through the
handle name named MyHandle, the alternative local short syntax version will look like:

ds(("MyHandle::MyFunction"