Extending Base Functions


Since a
function is a restricted and enhanced kind of class, it is possible to inherit an existing function declaration into the declaration of a new function. In this way you can declare the common structure of a set of functions as a partial base function which you subsequently inherit into the functions you want to define.


1 Base Function

OneArgBaseFunction is a partial base function with one argument and one result.



2 Extends Base Class

The functions myTan and addTen inherits the base function. By doing so the code becomes harder to read since the formal parameter list is not available in the functions.



Call it





3 myTan Call from a Class


Call it






4 addTen Call from a Class


Call it: