To show how the UFX function works, we will use the matrix created in the pre-
vious example (see the UCR function). To form matrix VAR into a user-defined
function, the following instruction would be entered:
1::t F' x v A
R
APL responds with the name of
:I: NTG-the user-defined function.
The OFX function produces an explicit result (the array of characters that repre-
sents the name of the user-defined function), and the original definition of the
user-defined function (if there was one) is replaced.
Now the function INTG can be displayed and executed:
TNTG 5
INTG 8
12345
1. 2 3 4 5 6 7 8
Following is an example that shows how the UCR and UFX functions can be
used to modify the definition of a function within another function. This
example will use the following userdefined function:
130
Format the function into a matrix:
Now, define a function called CHANGE, which, when performed, will execute a
modified version of INTG.
INTG is made a local function so that the
/global version will not be change (the local
v (:b.IA"jE ; xN'r'(3 ; y
version will not exist after the execution of
I:: :I. 3 M I:: 1.1. ; :I. 2 3 4.. ' :I: '
CHANGE is complete).
Assign the explicit result of the UFX function
to Y so that it will not be displayed.
Execute the modified version of INTG.
c: I: 2 ;:ni ::I ::I Ye. I: Nw [:IF x wq M
.
v
INTG.
CHANGE.
INTG again.
131
Previous Page Next Page