Names, Labels, and Functions

Definition of Terms

Labels and Labeled Values
Numbers and calculations on the stack may be given a label using the Label command. Labeled values can then be referenced using the name given to them via their label. Functions (see below) can also be labeled, and they can be executed by typing in their name. Using a label has a similar effect to saving a calculation or function to a user defined button except the label has to be typed each time by hand, and it works only in the current stack for as long as the labeled value exists on the stack.
Name
A Name can be inserted into a calculation as a reference to a label, or to a user defined button for a constant or expression. If a name doesn't reference a predefined label or button, than the calculation containing the undefined name becomes a function (see below).
Function
A Function is a calculation which contains one or more undefined names, and they can be executed using the methods described below. When a function is executed, entries are pulled off the stack to fill in the undefined names and the result is returned as an answer, similar to how a built in function like "+" or "sin" is executed.

Notes: Names and Labels may be composed of any combination of letters and numbers, but should not duplicate currently used built in calculator function names (or the result will just be the execution of the built in function).

Example of referencing a labeled result in a calculation

If the user enters the following commands into the calculator:

2 pi * twopi Label twopi 3 *

The result on the stack will look like this:

The first line of commands created the calculation of two times pi, and gave the calculation the label "twopi". The second line of commands used a Name which referenced the new label in a calculation.

Example of creating and using a Labeled Function

If the user enters the following commands into the calculator:

x 3 + plus3 Label 6 plus3

The result on the stack will look like this:

The first line of commands created a function which adds 3 to the input x, and gave the function the label "plus3". The second line of commands put a 6 on the stack and executed the function plus3 to give the result of 9.

Executing Functions using Exec

Functions may also be executed directly without labeling them by using the "Exec" key under the "Main" menu. This button results in previous stack entries being fed into the currently selected function. For instance, say the stack contains:

5, x + 2

Pressing the "Exec" key results in the stack value "5" being fed into the function "x + 2" leading to the result "7". This ability becomes quite powerful when combined with the calculators list functionality, which allows multiple inputs to be fed into the same formula at once. For instance, if the stack contains:

{5, 6, 7, 8}, x + 2

Pressing the "Exec" key will result in an answer of "{7 8 9 10}".

Other Uses for Functions

Functions may be assigned to a user defined button from the "Mem" menu and then used like a regular calculator function. Functions which use only one variable may also be graphed. Functions are also used for a handful of special functions such as the integration and derivative functions, and functions may be used as inputs into other calculations and functions via function references (Fref)