Search                        Top                                  Index
HELP IDENTFN                                           SH and AS Aug 1983


This procedure takes no inputs and produces no results, and does nothing.

It may seem to be a silly procedure! But it can be useful. Since it does
nothing, it leaves the stack unchanged. (See HELP * STACK). So it can be
thought of as a procedure whose results are always its arguments.
For example:

    identfn(3,4,5) =>
    ** 3 4 5
    identfn("cat") =>
    ** cat

It can be useful in two main sorts of ways:
    (a) as input to a procedure which takes a procedure as input
    (b) as default value of a global procedure variable which
        users may change.

-- Using IDENTFN as input to a procedure ------------------------------------

The procedure DL takes a list and puts all its elements on the stack. It can
be defined as:

    define dl(list);

The procedure EXPLODE, which takes an arbitrary data structure (other than a
list), and puts all its elements on the stack could be defined as

    define explode(structure);

-- Using IDENTFN as a default procedure -------------------------------------

A number of user definable procedures default to IDENTFN, e.g. * POPSETPOP
which is called whenever the procedure * SETPOP is run, after it has cleared
all stacks, etc, and before it starts compiling from the terminal.
Another is * POPEXIT, which is called by * SYSEXIT before it leaves POP-11.