home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / teach.zip / TEACH12A.ATF < prev    next >
Text File  |  1997-09-19  |  48KB  |  581 lines

  1. XNÉIO 0 1                                                                      °
  2. XNÉCT 0 1E²13                                                                  °
  3. XCÉFC 1 6 .,*0_²                                                               °
  4. XNÉRL 0 16807                                                                  °
  5. XCÉPR 1 1                                                                      °
  6. XCÉLX 1 5 TEACH                                                                °
  7. XAA╜(1)(2 3)('TEXT')                                                           °
  8. *(1996 4 6 16 7 6 220)                                                         °
  9. XFAND ÉFX 'Z╜(f AND g)R' 'Z╜(f R)(g R)'                                        °
  10. *(1996 4 6 16 7 6 220)                                                         °
  11.  FBIND ÉFX 'BIND' 'Σ Binding rules of APL2'                                    °
  12.   '''  1. Brackets bind to the left'''                                         °
  13.   '''  2. Left arrow binds to the left'''                                      °
  14.   '''  3. Dyadic operator binds to the right'''                                °
  15.   '''  4. Strand notation binding'''                                           °
  16.   '''  5. Operator binds to its left'''                                        °
  17.   '''  6. Function binds to its left'''                                        °
  18.   '''  7. Function binds to its right'''                                       °
  19. X '''  8. Left arrow binds to its right'',r'                                   °
  20. *(1997 9 14 12 30 44 504)                                                      °
  21. XFDISCLAIMER ÉFX 'DISCLAIMER' 'Σ Copyright statement' 'disclaimer'             °
  22. *(1996 4 6 16 7 6 220)                                                         °
  23.  FDISPLAY ÉFX 'D╜S DISPLAY A;ÉIO;R;C;HL;HC;HT;HB;VL;VB;V;W;N;B'                °
  24.   'Σ DISPLAY A GENERAL ARRAY IN PICTORIAL FORM'                                °
  25.   'Σ  NORMAL CALL IS MONADIC.  DYADIC CALL USED ONLY IN'                       °
  26.   'Σ    RECURSION TO SPECIFY DISPLAY RANK, SHAPE, AND DEPTH.' 'ÉIO╜0'          °
  27.   '»(0=ÉNC ''S'')/''S╜µA''' 'R╜╞µ,S                   Σ PSEUDO RANK.'          °
  28.   'C╜''┐┌└┘''                 Σ UR, UL, LL, AND LR CORNERS.'                   °
  29.   'HL╜''─''                   Σ HORIZONTAL LINE.'                              °
  30.   'HC╜HL,''Θ╕'',HL,''~+ε''      Σ HORIZONTAL BORDERS.'                         °
  31.   'HT╜HC[(0<R)⌡1+0<╞²1╞,S]' 'ΣW╜,0╧■╞0µΓ(1⌐µA)╞A'                              °
  32.   'HB╜HC[3+3╛(''2⌡~A╧«A'' ÉEA ''1+╞ε0⌡(1⌐⌡/µA)╞,A'')+3⌡1<µµS]'                 °
  33.   'VL╜''│''                   Σ VERTICAL LINE.'                                °
  34.   'VB╜VL,''Φ╟''               Σ VERTICAL BORDER.'                              °
  35.   'V╜VB[(1<R)⌡1+0<²1╞²1╟,S]'                                                   °
  36.   '»(0εµA)/''A╜(1⌐µA)µΓ╞A''   Σ SHOW PROTOTYPE OF EMPTIES.'                    °
  37.   '╕(1<╧A)/GEN' '╕(2<µµA)/D3'                                                  °
  38.   'D╜«A                     Σ SIMPLE ARRAYS.' 'W╜1╞µD╜(²2╞1 1,µD)µD'           °
  39.   'N╜²1+1╟µD' '╕(0=µµA)/SS'                                                    °
  40.   'D╜(C[1],V,((W-1)µVL),C[2]),((HT,NµHL),[0]D,[0]HB,NµHL),C[0],(WµVL),C[       °
  41.  3]' '╕0' 'SS:HB╜((0 '' '')=╞0µΓA)/'' -'''                                     °
  42.   'D╜'' '',('' '',[0]D,[0]HB,Nµ'' ''),'' ''' '╕0'                              °
  43.   'GEN:D╜«DISPLAY■A          Σ ENCLOSED ...' 'N╜Dδ.⌠'' '''                     °
  44.   'D╜(Nδ~1ΦN)≡D' 'D╜(δ≡~''  ''╤D)/D' 'D╜((1,µS)µS)DISPLAY D'                   °
  45.   '╕(2≥µ,S)╟D3E,0' 'D3:D╜0 ²1╟0 1╟«ΓA         Σ MULT-DIMENSIONAL ...'          °
  46.   'W╜1╞µD' 'N╜²1+1╟µD'                                                         °
  47.   'D╜(C[1],V,((W-1)µVL),C[2]),((HT,NµHL),[0]D,[0]HB,NµHL),C[0],(WµVL),C[       °
  48.  3]' 'D3E:N╜²2+µ,S'                                                            °
  49. X 'V╜C[Nµ1],[0]VB[1+0<²2╟,S],[0](((²3+╞µD),N)µVL),[0]C[Nµ2]' 'D╜V,D'           °
  50. *(1996 4 6 16 7 7 224)                                                         °
  51.  FEACHLEAF ÉFX 'U╜V(f EACHLEAF)W' 'Σ Apply f to each leaf of W'                °
  52. X '╕(V<╧W)/L0' 'U╜f■W' '╕0' 'L0:U╜V f EACHLEAF■W'                              °
  53. *(1996 4 6 16 7 6 220)                                                         °
  54.  FEXIT ÉFX 'EXIT' 'Σ Exit from function' '''To log off type:   )OFF'''         °
  55. X '╕'                                                                          °
  56. *(1996 4 6 16 7 6 220)                                                         °
  57.  FGO ÉFX 'GO;T;E;B' 'Σ Expression driver' 'L0:B╜E╜''''' 'æ╜''      '''         °
  58.   'T╜æ' '╕(^/'' ''=T)/L0' '╕((^/'')OFF ''=5╞6╟T)doif ''EXIT'')/0'              °
  59.   '╕(('':''εT)doif ''B╜evaldd (+/^\'''' ''''=T)╟T'')/L0'                       °
  60.   '''E╜ÉEM'' ÉEA T' '╕(0=µ,E)/L0' '╕B/L0'                                      °
  61.   '''This is not a valid APL2 expression''' 'æ╜''*'''                          °
  62. X '╕(''?''⌠╞1╟æ)/L0' 'E' '╕L0'                                                 °
  63. *(1997 8 17 11 30 6 356)                                                       °
  64.  FHELP ÉFX 'HELP;N;I;T' 'Σ Help to student' '''WHAT TO DO'',r'                 °
  65.   '''  ° To get out of the lesson''' '''       ENTER: EXIT'''                  °
  66.   '''  ° To log off APL2'''                                                    °
  67.   '''       FIRST, ENTER: EXIT  THEN ENTER: )OFF'''                            °
  68.   '''  ° To get help''' '''       ENTER: HELP'''                               °
  69.   '''  ° When you see the prompt on a blank line'''                            °
  70.   '''       ENTER AN APL2 EXPRESSION - OR JUST PRESS: ENTER''' 'do'            °
  71.   '''  ° If you get this line'',r'                                             °
  72.   '''This is not a valid APL2 expression'',r,''*'',r'                          °
  73.   '''        YOU CAN EITHER''' '''           A. PRESS: ENTER'''                °
  74.   '''           B. PRESS: ? and then ENTER to see what was incorrect'''        °
  75.   '''              in your expression causing that response'',r' 'do'          °
  76.   '''HINTS'',r'                                                                °
  77.   '''This lesson is made up of '',(«N╜5),'' components named TEACHx, whe       °
  78.  re''' '''the x stands for a digit:'',r' 'I╜0'                                 °
  79.   'L0:T╜''TEACH'',(«I╜I+1)' 'T,'' '',1╟notb(ÉCR T)[2;]' '╕(N>I)/L0'            °
  80.   'do'                                                                         °
  81.   '''You may review either of these components separately. To do that,''       °
  82.  '                                                                             °
  83.   '''first enter EXIT (and RETURN), then enter the name of the lesson.''       °
  84.  ' '''component (e.g. TEACH4).'',r'                                            °
  85.   '''To re-start the lesson, just enter TEACH'',r'                             °
  86.   '''When the screen fills up, it is a good idea to move the cursor to''       °
  87.  ' '''the start of a convenient paragraph, and press ENTER'',r'                °
  88.   '''You may also wish to press PAGE UP to review the prevous pages.'''        °
  89.   'do' '''RESOURCES'',r'                                                       °
  90.   '''You may also enter ONE of the following words at a time'',r'              °
  91. X '''REVIEW  Review the previous lesson''' 'endd'                              °
  92. *(1997 8 17 11 31 45 516)                                                      °
  93.  FHEXMATH ÉFX 'U╜V(f HEXMATH)W' 'Σ Hexadecimal integer arithmetic'             °
  94.   '╕(0=ÉNC ''V'')/MON ╪ U╜DtoH(HtoD V)f HtoD W ╪ ╕0'                           °
  95. X 'MON:U╜DtoH f HtoD W'                                                        °
  96. *(1996 4 6 16 7 7 224)                                                         °
  97. XFNEW1 ÉFX 'U╜L(f NEW1 g)R' 'Σ New operator' 'U╜(L f R)L g R'                  °
  98. *(1996 4 6 16 7 7 224)                                                         °
  99.  FREDUCE ÉFX 'U╜(f REDUCE)W' 'Σ Reduce nested scalars' '╕(0≤µW)/L0'            °
  100. X '╕(0=╧U╜W)/0' 'U╜Γf REDUCEπW' '╕0' 'L0:U╜f/W'                                °
  101. *(1996 4 6 16 7 6 220)                                                         °
  102.  FREVIEW ÉFX 'REVIEW' 'Σ Review of user defined functions'                     °
  103.   '''We learned that there are two ways for the APL2 user to define'''         °
  104.   '''functions. One way is to use the ÉFX System function, and the other       °
  105.  '''                                                                           °
  106.   '''is to use is to use the symbol ╖ to signal a switch to and from the       °
  107.  '''                                                                           °
  108.   '''function definition mode. (In commercial versions there are yet oth       °
  109.  er''' '''techniques based on the use of EDITORS.)'',r'                        °
  110.   '''A defined function consists of one HEADER line, followed by one or'       °
  111.  ''                                                                            °
  112.   '''more valid APL2 expressions. The header line describes to the APL2'       °
  113.  ''                                                                            °
  114.   '''interpreter the nature of the defined function (monadic, dyadic,'''       °
  115.   '''niladic and with or without a result; it also defines local labels.       °
  116.  )''' 'do'                                                                     °
  117.   '''The body of the defined function is normally evaluated in the seque       °
  118.  nce'''                                                                        °
  119.   '''of the expressions. This sequence can be altered with the usage of'       °
  120.  ''                                                                            °
  121.   '''the right arrow ╕. Whenever this arrow ocurrs, it is possible to ma       °
  122.  ke'''                                                                         °
  123.   '''a choice between branching to a line (or exit) or to continue in th       °
  124. Xe''' '''normal sequence.''' 'endd'                                            °
  125. *(1997 7 4 12 22 55 468)                                                       °
  126.  FTEACH ÉFX 'TEACH' 'Σ Start lesson 12: APL2 by Zdenek V JIZBA'                °
  127.   'exit ''TEACH''' 'initialize' 'TEACH1 Σ Outer product operator'              °
  128.   'TEACH2 Σ User defined operators'                                            °
  129.   'TEACH3 Σ Examples of user defined operators'                                °
  130.   'TEACH4 Σ More examples'                                                     °
  131. X 'TEACH5 Σ Locked functions; quad fix with left argument' 'problems'          °
  132. *(1997 6 20 13 10 27 372)                                                      °
  133.  FTEACH1 ÉFX 'TEACH1;FN;PRIME;T' 'Σ Outer product operator'                    °
  134.   '''To review the previous lesson, enter REVIEW.'',r'                         °
  135.   '''In this lesson we will study user defined OPERATORS. However before       °
  136.  '''                                                                           °
  137.   '''we get into that subject, we must complete our study of the dot'''        °
  138.   '''operator. As we learn more about this operator, we will practice th       °
  139.  e''' '''newly acquired skills for defining APL2 functions.''' 'do'            °
  140.   '''In lesson 10 we studied the dot as an operator taking a left and a'       °
  141.  ''                                                                            °
  142.   '''right argument function. We named this the inner product, because''       °
  143.  '                                                                             °
  144.   '''regardless of the function used, the result reduced the combined'''       °
  145.   '''rank of the two arguments.'',r'                                           °
  146.   '''There is another usage of the dot operator. It is possible to'''          °
  147.   '''replace the left argument FUNCTION by the special symbol called the       °
  148.  '''                                                                           °
  149.   '''JOT (°). Any expression containing the string °.f (where f is any''       °
  150.  '                                                                             °
  151.   '''function) is called the OUTER PRODUCT. The rank of the result of'''       °
  152.   '''using °.f is the sum of the ranks of the two arguments'',r'               °
  153.   'show ''DISPLAY (∞5)°.⌡∞5'''                                                 °
  154.   '''In this example we applied the ⌡ function to two vectors, and got''       °
  155.  ' '''a multiplication table. The function need not be pervasive'',r'          °
  156.   'show ''DISPLAY (∞2)°.,∞2'''                                                 °
  157.   '''To illustrate how one might want to use this operator, consider the       °
  158.  '''                                                                           °
  159.   '''problem of generating a sequence of prime numbers. Let us assume'''       °
  160.   '''that we wish to define function PRIME.'',r'                               °
  161.   '''NOTE: There are far more efficient methods for computing prime'''         °
  162.   '''      numbers. Function PRIME is used here solely to illustrate'''        °
  163.   '''      the usage of the outer product and to refresh your memory'''        °
  164.   '''      of modulo arithmetic.'',r' 'do'                                     °
  165.   'show ''FN╜''''U╜FROM PRIME TO;T;P;R'''' ''''Σ Find primes from 1+FROM       °
  166.   to TO''''''' '''We can begin with the first 18 primes'',r'                   °
  167.   'show ''FN╜FN,Γ''''T╜2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61       °
  168.  '''''''                                                                       °
  169.   'show ''FN╜FN,''''U╜((T≤TO)^T>FROM)/T'''' ''''╕(61≥TO)/0'''''''              °
  170.   '''Note that T>FROM specifically excludes the value of FROM if prime.'       °
  171.  ',r' 'show ''ÉFX FN'' ''11 PRIME 17''' '1╟1 showfn ''PRIME'''                 °
  172.   '''If the value of TO is 61 or smaller, then we are done. Else, we hav       °
  173.  e''' '''some more work to do.''' 'do'                                         °
  174.   '''First we have to define some auxilliary local variables:'',r'             °
  175.   'show ''FN╜FN,''''FROM╜FROM-0=2|FROM'''' ''''R╜⌐TO*.5'''''''                 °
  176.   '''It will be convenient to insure that the value of FROM is odd. Then       °
  177.  '''                                                                           °
  178.   '''if a number N in the range of (FROM to TO) is not a prime, it will        °
  179.  be'''                                                                         °
  180.   '''of the form A⌡B. Le us assume that A<B. Then N will be prime if it        °
  181.  is''' '''NOT divisible by any integer in the range 2 to R≤N*0.5.'',r'         °
  182.   'show ''FN╜FN,''''FROM╜FROM⌐61'''' ''''P╜FROM+2⌡∞⌐(TO-FROM)÷2'''''''         °
  183.   '''There is no need to re-generate primes in the range 2 to 61.'''           °
  184.   '''We generate vector P of all odd numbers in the desired range.'',r'        °
  185.   'show ''FN╜FN,''''U╜U,(^≡0⌠(1╟T)°.|P)≡P'''' ''''╕(R≤0¥T)/0'''''''            °
  186.   '''The first expression uses the outer product with the residue functi       °
  187.  on.'''                                                                        °
  188.   '''Only those values of P will be retained that do not leave a residue       °
  189.   of'''                                                                        °
  190.   '''zero when divided by integers of 1╟T. (since values of P are all od       °
  191.  d,''' '''there is no need to test for division by 2.)''' 'do'                 °
  192.   'show ''ÉFX FN'' ''103 PRIME 147''' '1╟1 showfn ''PRIME'''                   °
  193.   '''This will work for integers less than (61*2) or 3721. For larger'''       °
  194.   '''integers we have still more work to do'',r'                               °
  195.   '''There may be integers in the vector U that are divisible by an'''         °
  196.   '''integer greater than ⌐/T'',r'                                             °
  197.   'show ''FN╜FN,''''T╜(0¥T) PRIME R'''' ''''U╜(^≡0⌠T°.|U)≡U'''''' ''ÉFX        °
  198.  FN'''                                                                         °
  199.   '''First we generate a new vector T of greater primes that have not ye       °
  200.  t'''                                                                          °
  201.   '''been tested. Then we apply the outer product of residues to T and U       °
  202.  ,''' '''and remove all integers in U divisible by T'',r'                      °
  203.   '1╟1 showfn ''PRIME'''                                                       °
  204.   '''This will work as long as there is sufficient free space in memory'       °
  205.  ''                                                                            °
  206.   '''to generate the outer product. If the vectors U and R are too long'       °
  207.  '' '''there may have to be yet more to this function.'',r'                    °
  208. X 'show ''9000 PRIME 9100''' 'endd'                                            °
  209. *(1997 8 31 12 54 43 660)                                                      °
  210.  FTEACH2 ÉFX 'TEACH2;PLUS;REDUCE;FN;OP;TEST;NV'                                °
  211.   'Σ User defined operators' '''USER DEFINED OPERATORS'',r'                    °
  212.   '''We already know how to define an APL2 function that will mimick a''       °
  213.  ' '''primitive function. Here is an example'',r'                              °
  214.   'show ''ÉFX ''''U╜V PLUS W'''' ''''U╜V+W'''''' ''3 PLUS ∞4'''                °
  215.   '''In APL2 it is possible to also define an operator in a similar way'       °
  216.  ',r'                                                                          °
  217.   'show ''ÉFX ''''U╜(f REDUCE) W'''' ''''ΣReduction operator'''' ''''U╜f       °
  218.  /W'''''''                                                                     °
  219.   '''The parentheses are required in the header for two reasons:'',r'          °
  220.   '''   1. To indicate that the APL2 object being defined is'''                °
  221.   '''      an operator, and not a function.'''                                 °
  222.   '''   2. To show the strong binding between the function and'''              °
  223.   '''      the defined operator.''' 'do' '1 showfn ''REDUCE'''                 °
  224.   '''The f in parentheses is called the OPERAND. It represents any valid       °
  225.  '''                                                                           °
  226.   '''primitive or defined function. Operator REDUCE is monadic with resp       °
  227.  ect'''                                                                        °
  228.   '''to its operand and monadic with respect to its argument (W). Note t       °
  229.  hat'''                                                                        °
  230.   '''for a monadic operator, the operand appears to the LEFT, and the'''       °
  231.   '''argument appears to the RIGHT. (Enter BIND to review binding rules)       °
  232.  '',r'                                                                         °
  233.   '''Any user defined function can be applied to an APL2 operator, provi       °
  234.  ded'''                                                                        °
  235.   '''the expression is a valid one. Also, when a defined operator is inv       °
  236.  oked,''' '''the parentheses of the header are not required'',r'               °
  237.   'show ''+/∞5'' ''PLUS/∞5'' ''+REDUCE ∞5'' ''PLUS REDUCE ∞5'''                °
  238.   '''It is therefore possible to define a set of functions and operators       °
  239.  '''                                                                           °
  240.   '''so that none of the special APL2 symbols need be used. This would b       °
  241.  e'''                                                                          °
  242.   '''useful in situations where the user has no access to an APL font.''       °
  243.  ,r' 'do'                                                                      °
  244.   '''The most general format of the header of a defined operator is'',r'       °
  245.   '''     RESULT╜LEFTARG (leftfn OPNAME rightfn) RIGHTARG'',r'                 °
  246.   '''In this most general case, the operator is dyadic in its operands,        °
  247.  and'''                                                                        °
  248.   '''dyadic in its arguments. The left argument (LEFTARG) of a defined''       °
  249.  '                                                                             °
  250.   '''operator can be made to be optional (ambivalent OPERATOR in its lef       °
  251.  t'''                                                                          °
  252.   '''argument). The right operand however, when present in the header,''       °
  253.  ' '''cannot be made ambivalent.''' 'do'                                       °
  254.   'show ''OP╜''''U╜L (f TEST g) R'''' ''''╕(2=ÉNC ''''''''L'''''''')/L0        °
  255.  ╪ L╜∞µR''''''' 'show ''OP╜OP,Γ''''L0:U╜L f.g R'''''' ''ÉFX OP'''              °
  256.   '1 showfn ''TEST'''                                                          °
  257.   '''Notice that in line [2] f.g is separated from L and R by a blank.''       °
  258.  ,r' 'show ''1 2+TEST⌡3 5'' ''+TEST⌡3 5''' 'do'                                °
  259.   '''There are two types of applications for defined operators:'',r'           °
  260.   ''' 1. Extensions to existing operators'''                                   °
  261.   ''' 2. Creation of entirely new operator types'',r'                          °
  262.   '''Let us explore first extensions to existing operators.''' 'do'            °
  263.   '''Before we describe examples of extensions to defined operators, it'       °
  264.  ''                                                                            °
  265.   '''should be noted that all operators (except EACH) imply a dyadic'''        °
  266.   '''function. Suppose now that we wish to extend an operator, say'''          °
  267.   '''reduction, to handle a scalar right argument of depth greater than        °
  268.  2'',r'                                                                        °
  269.   'show ''OP╜''''U╜(f REDUCE) W'''' ''''Σ Reduce nested scalars'''' ''''       °
  270.  ╕(0≤µW)/L0'''''''                                                             °
  271.   '''First we test whether the argument is of RANK 0.'''                       °
  272.   '''If it is not, branch to expression L0 with primitive reduction'''         °
  273.   '''operator. Else we have to enclose the reduction of the disclose'',r       °
  274.  '                                                                             °
  275.   'show ''OP╜OP,''''╕(0=╧U╜W)/0 ╪ U╜Γf REDUCE■ πW ╪ ╕0'''' ''''L0:U╜f/W'       °
  276.  ''''''                                                                        °
  277.   '''If the scalar has depth of zero, REDUCE returns the right argument.       °
  278.  '''                                                                           °
  279.   '''Else the reduction will be applied to the disclose of the argument,       °
  280.  ''' '''and the result will be enclosed.'',r' 'show ''ÉFX OP'''                °
  281.   '1 showfn ''REDUCE'''                                                        °
  282.   'show ''⌡REDUCE 5'' ''DISPLAY ÷/(10 6) (2 3)'' ''DISPLAY ÷REDUCE (10 6       °
  283.  ) (2 3)'''                                                                    °
  284.   'show ''-/4 1'' ''-REDUCE 4 1'' ''NV╜Γ((1 2) (3 4)) (5 6)'''                 °
  285.   'show ''+/NV'' ''PLUS REDUCE NV'''                                           °
  286.   '''FOOTNOTE: The current version of APL2 does not produce a valid'''         °
  287.   '''          result when the right argument is a null vector.'',r'           °
  288. X 'show ''^/∞0'' ''^REDUCE ∞0''' 'endd'                                        °
  289. *(1997 8 31 12 59 42 676)                                                      °
  290.  FTEACH3 ÉFX 'TEACH3;OP;EACHLEAF;T;HtoD;DtoH;AND'                              °
  291.   'Σ Operator extensions on monadic functions'                                 °
  292.   '''Earlier it was pointed out that the each operator was the only one'       °
  293.  ''                                                                            °
  294.   '''that can be applied to a monadic function. Let us develop an extens       °
  295.  ion'''                                                                        °
  296.   '''to a defined operator that works on monadic functions. (This exampl       °
  297.  e''' '''was brought to my attention by Roy Sykes.)'',r'                       °
  298.   'OP╜''U╜V (f EACHLEAF) W'' ''Σ Apply f to each leaf of W'''                  °
  299.   'OP╜OP,''╕(V<╧W)/L0 ╪ U╜f■W ╪ ╕0'' ''L0:U╜V f EACHLEAF■ W'''                 °
  300.   'T╜ÉFX OP'                                                                   °
  301.   '''This defined operator generalizes the use of the each operator'''         °
  302.   '1 showfn ''EACHLEAF'''                                                      °
  303.   '''If the right argument has a depth greater than that given by the le       °
  304.  ft'''                                                                         °
  305.   '''argument, the application of the function is delayed for the inner'       °
  306.  ''                                                                            °
  307.   '''elements of the array. Else the monadic function is applied.'',r'         °
  308.   'show ''DISPLAY µ■(1(2(3 4)))'' ''DISPLAY 3 µEACHLEAF (1(2(3 4)))'''         °
  309.   'show ''DISPLAY µ■■(1(2(3 4)))'' ''DISPLAY 2 µEACHLEAF (1(2(3 4)))'''        °
  310.   '''Here is another example of using EACHLEAF. Function ∞ requires its'       °
  311.  '' '''right argument to be a scalar integer'',r'                              °
  312.   'show ''DISPLAY 0 ∞EACHLEAF (2 (3 4))''' '''      NEW OPERATORS'',r'         °
  313.   '''Let us now consider examples of operators that are not available in       °
  314.  '''                                                                           °
  315.   '''APL2. Why should we want to do that in the first place, and under w       °
  316.  hat''' '''conditions would this be useful?''' 'do'                            °
  317.   '''Since an operator is used to modify a function to produce a DERIVED       °
  318.  '''                                                                           °
  319.   '''function, there may be situations where a certain activity is desir       °
  320.  ed''' '''regardless of the applied function.'',r'                             °
  321.   '''What a defined operator allows us to do is to DELAY BINDING until t       °
  322.  he'''                                                                         °
  323.   '''time of invocation of the function. The simplest example of this is       °
  324.  ''' '''the favorite one of Ray Polivka'''                                     °
  325.   'T╜ÉFX ''U╜(f AND g) W'' ''Σ Catenate functions'' ''U╜(f W) (g W)'''         °
  326.   '1 showfn ''AND''' '''Here is how Ray would use this operator'',r'           °
  327.   'show ''A╜(1(2 3)''''TEXT'''')'' ''µ AND ╧A'' ''µ AND ╧ AND DISPLAY A'       °
  328.  '' '''Here is another example:'''                                             °
  329.   '''Consider other than decimal number systems. In the hexa-decimal'''        °
  330.   '''notation, we use the letters A,B,C,D,E and F to denote the integers       °
  331.  '''                                                                           °
  332.   '''10, 11, 12, 13, 14 and 15. Hexa-decimal 15, for example stands for'       °
  333.  ''                                                                            °
  334.   '''decimal 21 (since it is equal to decimal 16 + 5). We could therefor       °
  335.  e''' '''define an operator to do Hexa-decimal arithmetic.''' 'do'             °
  336.   '''Before we can do that, we have to define two functions: DtoH and Ht       °
  337.  oD''' 'OP╜''U╜DtoH W'' ''Σ Convert decimal integers to hexadecimal'''         °
  338.   'T╜ÉFX OP,Γ''U╜''''0123456789ABCDEF''''[1+((1+╛16╡W)µ16)ÿW]'''               °
  339.   '1 showfn ''DtoH'''                                                          °
  340.   'OP╜''U╜HtoD W'' ''Σ Convert hexadecimal strings to decimals'''              °
  341.   'T╜ÉFX OP,Γ''U╜16¥²1+''''0123456789ABCDEF''''∞W'''                           °
  342.   '1 showfn ''HtoD''' '''We should verify these functions first'',r'           °
  343.   'show ''DtoH 256'' ''HtoD ''''100'''''' ''DtoH 255'' ''HtoD ''''FF''''       °
  344.  ''' '''Now we can define function HEXMATH'',r'                                °
  345.   'OP╜''U╜V (f HEXMATH) W'' ''Σ Hexadecimal integer arithmetic'''              °
  346.   'OP╜OP,Γ''╕(0=ÉNC ''''V'''')/MON ╪ U╜DtoH (HtoD V) f HtoD W ╪ ╕0'''          °
  347.   'T╜ÉFX OP,Γ''MON:U╜DtoH f HtoD W''' '1 showfn ''HEXMATH'''                   °
  348.   '''Line [2] deals with dyadic expressions, while line [3] handles mona       °
  349.  dic''' '''ones. Let us see how this function works'',r'                       °
  350.   'show ''''''1'''' +HEXMATH ''''FF'''''' ''''''ABC'''' ⌡HEXMATH ''''CBA       °
  351.  ''''''' '''and to verify this last expression'',r'                            °
  352.   'show ''''''889C98''''╧DtoH (HtoD ''''ABC'''')⌡HtoD ''''CBA'''''''           °
  353. X 'endd'                                                                       °
  354. *(1997 6 21 12 26 42 496)                                                      °
  355.  FTEACH4 ÉFX 'TEACH4;NEW;NEW1;T'                                               °
  356.   'Σ Dyadic defined operator with two functions'                               °
  357.   '''When defining a new operator you should at first proceed with much'       °
  358.  ''                                                                            °
  359.   '''caution. It is important to analyze the binding of all expressions.       °
  360.  ''' 'do'                                                                      °
  361.   '''Here is an example of a new dyadic operator using two functions as'       °
  362.  '' '''an argument'''                                                          °
  363.   'T╜ÉFX ''U╜L (f NEW g) R'' ''Σ New operator'' ''U╜(L f R) (L g R)'''         °
  364.   '1 showfn ''NEW'''                                                           °
  365.   'show ''5 +NEW- 3'' ''DISPLAY (1 (2 3)) +NEW⌡ 5 (6 2)'''                     °
  366.   '''We will now re-define a similar operator, but with one very minor''       °
  367.  '                                                                             °
  368.   '''change. (Such a change would have no effect on a defined function.)       °
  369.  '''                                                                           °
  370.   'T╜ÉFX ''U╜L (f NEW1 g) R'' ''Σ Another operator'' ''U╜(L f R) L g R''       °
  371.  ' '1 showfn ''NEW1'''                                                         °
  372.   '''The only difference is in the missing parentheses on the dyadic'''        °
  373.   '''function g'',r' 'show ''5 +NEW1- 3'''                                     °
  374.   '''Let us analyze what happens. First let us look at binding rules:'',       °
  375.  r' 'BIND' 'do'                                                                °
  376.   '''Why does 5 +NEW1- 3 produce 5 2? Let us look at the expression'',r'       °
  377.   '''              (L f R) L g R'',r'                                          °
  378.   '''BY binding rule 3, the g is bound to R and then the f is bound to R       °
  379.  .'''                                                                          °
  380.   '''Then by rule 4. (L f R) L is bound as a vector. Finally by rule 5''       °
  381.  '                                                                             °
  382.   '''the two element vector (L f R) L is bound to g. We therefore evalua       °
  383.  te'',r' 'show ''5 + 3'' ''8 5 - 3'''                                          °
  384.   '''As an exercise, you should go through the process of evaluation'''        °
  385.   '''of the expression: (1 (2 3)) +NEW1⌡ (5 (6 2))'',r'                        °
  386. X 'show ''DISPLAY (1 (2 3)) +NEW1⌡ 5 (6 2)''' 'endd'                           °
  387. *(1997 6 21 12 32 57 580)                                                      °
  388.  FTEACH5 ÉFX 'TEACH5;FOO' 'Σ Locked functions'                                 °
  389.   '''If you use APL2 for commercial applications, you may wish to keep''       °
  390.  ' '''your algorithms secret. APL2 provides a feature that in effect'''        °
  391.   '''prevents a defined function (or operator) from being displayed.'''        °
  392.   '''One way to do it is to use the symbol ·. This symbol is a toggle'''       °
  393.   '''switch similar to ╖, except that the defined function becomes'''          °
  394.   '''LOCKED. Once locked it is extremely difficult to reveal its'''            °
  395.   '''internal algorithm.'',r'                                                  °
  396.   '''When a function is defined with the · symbol, it is a good idea to'       °
  397.  '' '''have an unlocked copy in a separate workspace.''' 'do'                  °
  398.   '''There is another way to lock defined functions. The ÉFX System'''         °
  399.   '''Function can be used with a left argument'',r'                            °
  400.   'show ''0 0 0 0 ÉFX ''''U╜FOO W'''' ''''U╜∞W'''''' ''ÉCR ''''FOO''''''       °
  401.   ''FOO 5'''                                                                   °
  402.   '''In the above example, the vector of zeros is equivalent to not'''         °
  403.   '''having a left argument. However a 1 in any one of these positions''       °
  404.  ' '''will have as an effect a restriction on the defined function'',r'        °
  405.   'show ''1 0 0 0 ÉFX ''''U╜FOO W'''' ''''U╜∞W'''''' ''ÉCR ''''FOO''''''       °
  406.   ''FOO 5'''                                                                   °
  407.   '''Even though function FOO exists and works, it cannot be displayed.'       °
  408.  '' '''A 1 in the other positions deals with the ability to suspend,'''        °
  409.   '''interrupt and produce error messages. If this subject is of interes       °
  410. Xt,''' '''you should consult the appropriate manuals.''' 'endd'                °
  411. *(1996 4 6 16 7 7 224)                                                         °
  412. XFTEST ÉFX 'U╜L(f TEST g)R' '╕(2=ÉNC ''L'')/L0' 'L╜∞µR' 'L0:U╜Lf.gR'           °
  413. *(1997 7 13 12 28 49 504)                                                      °
  414.  Faddquote ÉFX 'u╜addquote w'                                                  °
  415.   'Σ Put quotes around a string, and double existing quotes'                   °
  416. X 'u╜ÉAV[40],((1+w=ÉAV[40])/w),ÉAV[40]'                                        °
  417. *(1997 7 24 13 20 38 476)                                                      °
  418.  Fav ÉFX 'av;A;N;I;ÉIO' 'Σ Display characters in ÉAV' 'ÉIO╜0'                  °
  419.   'A╜22 78µ'' ''' 'N╜3 0«φ12 22µ1+∞356' 'A[;,(6⌡∞12)°.+2 3 4]╜N'               °
  420.   'A[;6+6⌡∞12]╜φ12 22µÉAV' 'ΣA[8 10 13;6]╜'' ''' 'A[13;6]╜'' '''               °
  421. X 'A[14+∞8;68 69 70 72]╜'' ''' 'A'                                             °
  422. *(1991 11 11 8 25 13 316)                                                      °
  423.  Fdate ÉFX 'u╜date w' 'Σ Format date and time of day' 'u╜«6╞w'                 °
  424. X 'u╜('' ''⌠u)Γu' 'u╜εu,■''-- .. '''                                           °
  425. XCdig 1 10 1234567890                                                          °
  426. *(1997 9 9 13 0 45 372)                                                        °
  427.  Fdisclaimer ÉFX 'disclaimer' 'Σ Copyright statement'                          °
  428.   '(10µ'' ''),''Copyright, Z. V. Jizba, 1995,1996,1997'',r'                    °
  429.   ''' This and subsequent workspaces labelled TEACHxx are made available       °
  430.  '''                                                                           °
  431.   '''at no cost to anyone who desires to learn how to use effectively'''       °
  432.   '''the IBM/OS2 version of APL2.'',r'                                         °
  433.   '''This software is provided "AS IS" with no WARRANTY of any kind, eit       °
  434.  her'''                                                                        °
  435.   '''express or implied. Any risk in its use resides with you, the user        °
  436.  of''' '''these tutorials.'',r' '''     ACKNOWLEDGEMENTS'',r'                  °
  437.   ''' In writing these tutorials, I am greatly indebted to Roy Sykes, wh       °
  438.  ose'''                                                                        °
  439.   '''excellent lectures increased my understanding of the language.'''         °
  440.   '''Discussions with the late Harry Bertucelli clarified a number of'''       °
  441.   '''concepts and caused me to change some improper terminology that was       °
  442.  '''                                                                           °
  443.   '''used in previous versions of these tutorials. Mr. Benjamin Archer''       °
  444.  '                                                                             °
  445.   '''kindly checked out a nearly final version, bringing to my attention       °
  446.  ''' '''some ommisions, misspellings, and invalid terminology.'',r'            °
  447. X '''(PRESS ENTER to continue)'''                                              °
  448. *(1997 7 13 12 28 50 508)                                                      °
  449.  Fdo ÉFX 'do;T;E' 'Σ Expression driver' 'E╜''''' 'æ╜''      ''' 'T╜æ'          °
  450.   '╕(^/'' ''=T)/0'                                                             °
  451.   '╕(('':''εT)doif ''B╜evaldd (+/^\'''' ''''=T)╟T'')/2'                        °
  452.   '''E╜ÉEM'' ÉEA T' '╕(0=µ,E)/2'                                               °
  453.   '''This is not a valid APL2 expression''' 'æ╜''*''' '╕(''?''⌠╞1╟æ)/2'        °
  454. X 'E' '╕2'                                                                     °
  455. *(1997 7 13 12 28 50 508)                                                      °
  456.  Fdoif ÉFX 'U╢╜V╢ doif W╢;t╢' 'Σ Rule' '╕(^/~U╢╜V╢)/0'                         °
  457. X '''U╢╜V╢ doif■ W╢'' ÉEA ''»V╢/W╢'''                                          °
  458. *(1997 9 9 12 50 14 444)                                                       °
  459.  Fendd ÉFX 'endd' 'Σ end of special feature' '20µ''²'' ╪ ╕(4<µÉLC)/0'          °
  460. X 'do'                                                                         °
  461. *(1997 8 17 11 27 25 420)                                                      °
  462.  Ferase ÉFX 'erase;t;EXIT;GO;HELP;DISPLAY;BIND;REVIEW;RULE;DISCLAIMER'         °
  463.   'Σ Erase all global functions and variables' 't╜ÉNL 3'                       °
  464.   't╜(~t^.εlc,'' '')≡t' 't╜ÉEX(~t[;∞5]^.=''TEACH'')≡t' 't╜ÉNL 2'               °
  465. X 't╜ÉEX(~t^.εlc,'' '')≡t'                                                     °
  466. *(1997 7 27 13 47 41 608)                                                      °
  467.  Fevaldd ÉFX 'u╜evaldd w;c;n' 'Σ Evaluate direct definition' 'u╜0'             °
  468.   'n╜(w∞''Σ'')-1' 'c╜(((n╞w)⌠'':'')Γn╞w),Γ''ΣDD '',(n+1)╟w'                    °
  469.   '╕((1 label╞c)doif ''''''Invalid label'''''')/0'                             °
  470.   '╕((2=µc)doif ''u╜showdd 1╙c'')/0'                                           °
  471.   '╕((3=ÉNC╞c)doif ''u╜⌡µÉ╜(╞c),'''' is already defined.'''''')/0'             °
  472.   '╕((3=µc)doif ''u╜simdd c'')/0' 'c╜(Γ''α∙ aw'')replace■c'                    °
  473.   'u╜ε''u╜'',((''a''εεc[2 3 4])/''a ''),(╞c),'' w;t;b'''                       °
  474.   'u╜u(5πc)(''b╜(t╜'',(3πc),'')/'',addquote ''u╜'',4πc)'                       °
  475. X 'u╜u,''╕(t doif b)/0''(''u╜'',2πc)' 'u╜╧ÉFX u'                               °
  476. *(1997 7 25 13 27 52 564)                                                      °
  477.  Fexit ÉFX 'V exit W;T' 'Σ Exit if too many suspended functions'               °
  478.   '╕(0⌠ÉNC ''V'')/L0 ╪ V╜10' 'L0:╕(V>µÉLC)/0'                                  °
  479.   '''There are too many suspended functions''' '''Please enter '',W'           °
  480. X '╕'                                                                          °
  481. *(1997 7 26 12 33 39 536)                                                      °
  482.  Fget ÉFX 'U╜V get W;t;T;ÉPR' 'Σ Prompt for response from keyboard'            °
  483.   'ÉPR╜T╜ÉAV[ÉIO+255] ╪ ╕(0⌠ÉNC ''V'')/L0 ╪ V╜1' 'L0:V╜V╧1' 'æ╜W ╪ t╜æ'        °
  484.   'U╜(+/^\t=T)╟t' '╕(''╕''⌠╞U)/L1 ╪ ╕' 'L1:╕V/0' 't╜(U⌠'' '')ΓU'               °
  485. X 'U╜(µt),(ΓU),t'                                                              °
  486. *(1997 7 28 13 33 8 424)                                                       °
  487.  Fglobals ÉFX 'globals' 'Σ Initialize useful global variables'                 °
  488.   'uc╜''ABCDEFGHIJKLMNOPQRSTUVWXYZ'''                                          °
  489.   'lc╜''abcdefghijklmnopqrstuvwxyz''' 'dig╜''1234567890'''                     °
  490. X 'r╜ÉAV[13+ÉIO]' 'q╜'''''''''                                                 °
  491. *(1997 7 3 12 47 6 368)                                                        °
  492.  Finitialize ÉFX 'initialize;T' 'Σ Initialize workspace'                       °
  493.   '''AT ALL TIMES, TO CONTINUE, PRESS RETURN!'',r'                             °
  494.   '''To see disclaimers enter:'',r,''    disclaimer''' 'do' 'erase'            °
  495.   'globals'                                                                    °
  496.   '''Make sure the CAP LOCK light on your keyboard (upper right) is ON!'       °
  497. X'' 'endd'                                                                     °
  498. *(1997 7 27 13 14 33 444)                                                      °
  499.  Flabel ÉFX 'u╜v label w'                                                      °
  500.   'Σ Return 1 if label w does not begin with a cap'                            °
  501.   '╕(0⌠ÉNC ''v'')/L0 ╪ v╜0' 'L0:v╜v╧1 ╪ w╜εw ╪ ╕v/L1 ╪ ╕(u╜0⌠ÉNC w)/0'         °
  502. X 'L1:╕(u╜~^/wεlc,uc,dig)/0' 'u╜w[1]εlc,dig'                                   °
  503. XClc 1 26 abcdefghijklmnopqrstuvwxyz                                           °
  504. *(1997 7 13 12 28 55 528)                                                      °
  505.  Fnon ÉFX 'non;T;RC;ET;R' 'Σ Ignore keyboard entry' 'æ╜''      ''' 'T╜æ'       °
  506.   '╕(0=µ(T⌠'' '')/T)/0' '(RC ET R)╜ÉEC T' '╕(0=RC)/2'                          °
  507. X '╕((1=RC)doif ''R'')/2' '╕2'                                                 °
  508. *(1997 7 13 12 28 55 528)                                                      °
  509.  Fnotb ÉFX 'u╜notb w' 'Σ Remove trailing blanks'                               °
  510.   '╕((1<╧w)doif ''u╜notb■ w'')/0' '╕((1<µµw)doif ''u╜πnotb Γ[2]w'')/0'         °
  511. X 'u╜(1-(,'' ''⌠Φw)∞1)╟w'                                                      °
  512. *(1997 7 27 12 55 6 496)                                                       °
  513.  Fproblems ÉFX 'problems' 'Σ Problems'                                         °
  514.   '''That is all for this lesson. Remember, if you want to practice,'''        °
  515.   '''and plan to use direct definitions, be sure to first enter GO.'''         °
  516.   '''Direct definitions will then be accepted. To exit GO, enter EXIT.''       °
  517.  ,r'                                                                           °
  518.   '''To erase a previously defined DIRECT DEFINITION FUNCTION, enter'',r       °
  519.  ' '''       )ERASE functionname'',r'                                          °
  520. X '''WARNING! do not use )ERASE on other labels.'',r'                          °
  521. XCq 0 '                                                                        °
  522. XCr 0                                                                         °
  523. *(1997 7 13 12 28 56 532)                                                      °
  524.  Freplace ÉFX 'u╜v replace u;i;r;s' 'Σ Replace elements in v in u'             °
  525.   'i╜Γ∞µu' 's╜2πv╜(v⌠'' '')Γv' 'i╜⌡r╜i⌡■Γ[1]u°.=╞v'                            °
  526. X 'u[(εi)/εr]╜s[(εi)/εi⌡■∞µs]'                                                 °
  527. *(1997 7 13 12 28 56 532)                                                      °
  528.  Fround ÉFX 'U╜V round W' 'Σ Half adjust to V th decimal'                      °
  529. X 'U╜(╛0.5+W⌡10*V)÷10*V'                                                       °
  530. *(1997 7 13 12 28 57 536)                                                      °
  531.  Fshow ÉFX '╢V show ╢W;╢T;╢B' 'Σ Display and execute ╢W'                       °
  532.   '╢T╜(0=ÉNC ''╢V'')doif ''╢V╜0'''                                             °
  533.   '╕((0=╧╢W)doif ''show ╢W,'''' '''''')/0'                                     °
  534.   '╕((1<╧╢W)doif ''╢V show ■╢W'')/0' '''      '',╢W'                           °
  535. X '╕((╢V^'':''ε╢W)doif ''╢T╜evaldd ╢W'')/L0' '''ÉEM'' ÉEA ╢W' 'L0:do'          °
  536. *(1997 7 13 12 28 57 536)                                                      °
  537.  Fshowdd ÉFX 'u╜showdd w;a;b;c;r'                                              °
  538.   'Σ Display a direct definition function'                                     °
  539.   '╕((1=╧w)doif ''u╜showdd Γw'')/u╜0'                                          °
  540.   '╕((3⌠ÉNC╞w)doif ''(ε╞w),'''' is not a function'''''')/0'                    °
  541.   'c╜Γ[2]ÉCR╞w' 'c╜notb(2╞c),(Γ''aw α∙'')replace■2╟c'                          °
  542.   '╕((~''ΣDD''╧3╞2πc)doif ''''''Not a direct definition function'''''')/       °
  543.  0' 'u╜1' 'b╜('' ''⌠╞c)Γ╞c' 'a╜''      ''' 'r╜2╟3πc'                           °
  544.   '╕((3=µc)doif ''a,(╞w),'''':'''',r,(3<µ2πc)/''''   Σ'''',3╟2πc'')/0'         °
  545.   'a╜a,(╞w),'':'',(2╟5πc),'':''' 'b╜(+\r=''('')-+\r='')''' 'b╜b∞0'             °
  546. X 'a╜a,(²3╟(b-1)╞3╟r),'':'',2╟»(b+2)╟r' 'a,(3<µ2πc)/''  Σ'',3╟2πc'             °
  547. *(1997 7 13 12 28 57 536)                                                      °
  548.  Fshowfn ÉFX 'U╜V showfn W;F;N;T;ÉIO' 'Σ Simulate ╖W[É]'                       °
  549.   'T╜(0=ÉNC ''V'')doif ''V╜0''' 'ÉIO╜0'                                        °
  550.   'U╜r,''      '',''╖'',W,''[É]'',(╞V)╞''╖''' 'N╜1╞µF╜ÉCR W' 'N╜«∞N'           °
  551.   'N╜(N⌠'' '')ΓN' 'F╜(π''['',■N,■Γ''] ''),F'                                   °
  552.   'T╜(1<µ,V)doif ''F╜F[1╟V;]'' ''U╜''''''''''' 'U╜²1╟U,r,,F,r'                 °
  553. X 'U╜((-+/^\'' ''=ΦU)╟U),('' ╖'')[╞V],r'                                       °
  554. *(1997 7 13 12 28 58 540)                                                      °
  555.  Fsimdd ÉFX 'u╜simdd w;e' 'Σ Direct definition mode' 'u╜0'                     °
  556.   '╕((0⌠ÉNC╞w)doif ''''''Already defined'''''')/0' 'e╜''α''ε2πw'               °
  557.   'w[2]╜Γ''u╜'',''α∙ aw'' replace 2πw' 'w╜w[1 3 2]'                            °
  558. X 'w[1]╜Γε''u╜'',(e/''a ''),w[1],'' w''' 'u╜╧ÉFX w'                            °
  559. *(1992 6 3 9 59 17 424)                                                        °
  560.  Ftab ÉFX 'U╜V tab W;T;A;B;C;D;E;F;G;M;ÉPW' 'Σ Tabulate list W'                °
  561.   'T╜(0=ÉNC ''V'')doif ''V╜0''' 'M╜''Invalid data for tabulation'''            °
  562.   'V╜4╞V' 'ÉPW╜130╛30⌐G╜V[2]+79⌡V[2]=0'                                        °
  563.   'L1:╕((1<╧W)doif ''''''W╜∞0'''' ÉEA ''''W╜πW'''''')/L1'                      °
  564.   '╕(((0=µεW)δ2<µµW)doif ''U╜(~V╧4╞0)/M'')/0'                                  °
  565.   'T╜(1≥µµU╜«W)doif ''U╜πW╜(U⌠'''' '''')ΓU'''                                  °
  566.   'T╜(0<V[1])doif ''U╜(«(Φ1,╞µW)µ(V[3]µ'''' ''''),∞(╞µW)-V[3]),'''' ''''       °
  567.  ,U''' '╕(G<30)/0' 'T╜(F╜µεV[4])+C╜1╟B╜µA╜(V[3],0)╟U'                          °
  568.   'T╜⌐(1╞B)÷1⌐╛(ÉPW+F)÷T' 'U╜(E╜(V[3],C)╞U),[1](B╜T,1╟B)╞A'                    °
  569.   '''D╜εV[4]'' ÉEA ''D╜ÉAV[εV[4]+33⌡V[4]=0]''' 'L0:A╜(T,0)╟A'                  °
  570. X '╕(0=1╞µA)/0' 'U╜U,(((T+V[3]),µD)µD),E,[1]B╞A' '╕L0'                         °
  571. *(1997 7 13 12 28 59 544)                                                      °
  572.  Ftest ÉFX 'U╜V test W;P'                                                      °
  573.   'Σ Describe problem in W, (correct answer in V)' 'U╜2' 'L1:W'                °
  574.   'É╜''      ''' 'P╜æ' '''╕L0'' ÉEA ''P╜»P''' '╕(V╧P)/0'                       °
  575. X 'L0:╕(0=U╜U-1)/0' '''Incorrect. Try again''' '╕L1'                           °
  576. XCuc 1 26 ABCDEFGHIJKLMNOPQRSTUVWXYZ                                           °
  577. *(1996 4 6 16 7 6 220)                                                         °
  578.  Fvec ÉFX 'U╜vec' 'Σ Draw 2d vector in plane'                                  °
  579.   'U╜r,r,''2-        +'',r '':      °'',r,''1-    °'',r'                       °
  580. X 'U╜U,'' :  °'',r,''0|....|....|'',r,'' 0    1    2'',r'                      °
  581.