home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / teach.zip / TEACH16A.ATF < prev    next >
Text File  |  1997-09-19  |  56KB  |  683 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. *(1996 4 6 16 9 6 228)                                                         °
  8.  FBIND ÉFX 'BIND' 'Σ Binding rules of APL2'                                    °
  9.   '''  1. Brackets bind to the left'''                                         °
  10.   '''  2. Left arrow binds to the left'''                                      °
  11.   '''  3. Dyadic operator binds to the right'''                                °
  12.   '''  4. Strand notation binding'''                                           °
  13.   '''  5. Operator binds to its left'''                                        °
  14.   '''  6. Function binds to its left'''                                        °
  15.   '''  7. Function binds to its right'''                                       °
  16. X '''  8. Left arrow binds to its right'',r'                                   °
  17. *(1997 7 8 13 23 39 428)                                                       °
  18.  FCOMMANDS ÉFX 'COMMANDS' 'Σ Summary of System commands'                       °
  19.   '''   )CHECK              Obtain diagnostic information'''                   °
  20.   '''   )CLEAR              Reset to a blank workspace called CLEAR'''         °
  21.   '''   )CONTINUE           Save in workspace CONTINUE with suspensions'       °
  22.  ''                                                                            °
  23.   '''   )COPY ws obj1[obj2] Copy from workspace ''''ws'''' APL2 object[s       °
  24.  ] ''''obj*'''''''                                                             °
  25.   '''   )DROP wsid          Remove ''''wsid'''' from library (same as DO       °
  26.  S ERASE)'''                                                                   °
  27.   '''   )EDITOR #           Select APL2 editor (only 1 in APL2OS2)'''          °
  28.   '''   )ERASE object       Remove named object from workspace'''              °
  29.   '''   )FNS                List all defined functions in workspace'''         °
  30.   '''   )HOST               Submit OS2/dos command'''                          °
  31.   '''   )LIB [#]            Lists all workspaces [in library #]'''             °
  32.   '''   )LOAD ws            Load workspace ''''ws'''''''                       °
  33.   '''   )MORE               Obtain more information on error message'''        °
  34.   '''   )NMS                List ALL APL2 objects in workspace'''              °
  35.   '''   )OFF                Logs you off from APL2. Returns to DOS'''          °
  36.   '''   )OPS                List all uder defined operators'''                 °
  37.   '''   )OUT name           Save workspace in ATF format'''                    °
  38.   '''   )PCOPY name [name]  Copy only object not already in workspace'''       °
  39.   '''   )PIN name [name]    Copy from ATF file object not already in wor       °
  40.  kspace''' '''   )RESET [#]          Clear State Indicator'''                  °
  41.   '''   )SAVE               Store workspace in a file (wsid.TRY in TRYAP       °
  42.  L2)'''                                                                        °
  43.   '''   )SAVE name          Store workspace in file ''''name.TRY'''''''        °
  44.   '''   )SI                 (Returns blank in TRYAPL2)'''                      °
  45.   '''   )SIC                Synonym of )RESET'''                               °
  46.   '''   )SINL               List state indicator with name list'''             °
  47.   '''   )SYMBOLS [#]        List/Specify nimber of symbols in symbol tab       °
  48.  le'''                                                                         °
  49.   '''   )VARS               List all variables currently active in works       °
  50.  pace'''                                                                       °
  51.   '''   )WSID               Supply the name of current workspace'''            °
  52. X '''   )WSID wsid          Rename current workspace ''''wsid'''''''           °
  53. *(1997 9 14 12 30 44 504)                                                      °
  54. XFDISCLAIMER ÉFX 'DISCLAIMER' 'Σ Copyright statement' 'disclaimer'             °
  55. *(1996 4 6 16 9 6 228)                                                         °
  56.  FDISPLAY ÉFX 'D╜S DISPLAY A;ÉIO;R;C;HL;HC;HT;HB;VL;VB;V;W;N;B'                °
  57.   'Σ DISPLAY A GENERAL ARRAY IN PICTORIAL FORM'                                °
  58.   'Σ  NORMAL CALL IS MONADIC.  DYADIC CALL USED ONLY IN'                       °
  59.   'Σ    RECURSION TO SPECIFY DISPLAY RANK, SHAPE, AND DEPTH.' 'ÉIO╜0'          °
  60.   '»(0=ÉNC ''S'')/''S╜µA''' 'R╜╞µ,S                   Σ PSEUDO RANK.'          °
  61.   'C╜''┐┌└┘''                 Σ UR, UL, LL, AND LR CORNERS.'                   °
  62.   'HL╜''─''                   Σ HORIZONTAL LINE.'                              °
  63.   'HC╜HL,''Θ╕'',HL,''~+ε''      Σ HORIZONTAL BORDERS.'                         °
  64.   'HT╜HC[(0<R)⌡1+0<╞²1╞,S]' 'ΣW╜,0╧■╞0µΓ(1⌐µA)╞A'                              °
  65.   'HB╜HC[3+3╛(''2⌡~A╧«A'' ÉEA ''1+╞ε0⌡(1⌐⌡/µA)╞,A'')+3⌡1<µµS]'                 °
  66.   'VL╜''│''                   Σ VERTICAL LINE.'                                °
  67.   'VB╜VL,''Φ╟''               Σ VERTICAL BORDER.'                              °
  68.   'V╜VB[(1<R)⌡1+0<²1╞²1╟,S]'                                                   °
  69.   '»(0εµA)/''A╜(1⌐µA)µΓ╞A''   Σ SHOW PROTOTYPE OF EMPTIES.'                    °
  70.   '╕(1<╧A)/GEN' '╕(2<µµA)/D3'                                                  °
  71.   'D╜«A                     Σ SIMPLE ARRAYS.' 'W╜1╞µD╜(²2╞1 1,µD)µD'           °
  72.   'N╜²1+1╟µD' '╕(0=µµA)/SS'                                                    °
  73.   'D╜(C[1],V,((W-1)µVL),C[2]),((HT,NµHL),[0]D,[0]HB,NµHL),C[0],(WµVL),C[       °
  74.  3]' '╕0' 'SS:HB╜((0 '' '')=╞0µΓA)/'' -'''                                     °
  75.   'D╜'' '',('' '',[0]D,[0]HB,Nµ'' ''),'' ''' '╕0'                              °
  76.   'GEN:D╜«DISPLAY■A          Σ ENCLOSED ...' 'N╜Dδ.⌠'' '''                     °
  77.   'D╜(Nδ~1ΦN)≡D' 'D╜(δ≡~''  ''╤D)/D' 'D╜((1,µS)µS)DISPLAY D'                   °
  78.   '╕(2≥µ,S)╟D3E,0' 'D3:D╜0 ²1╟0 1╟«ΓA         Σ MULT-DIMENSIONAL ...'          °
  79.   'W╜1╞µD' 'N╜²1+1╟µD'                                                         °
  80.   'D╜(C[1],V,((W-1)µVL),C[2]),((HT,NµHL),[0]D,[0]HB,NµHL),C[0],(WµVL),C[       °
  81.  3]' 'D3E:N╜²2+µ,S'                                                            °
  82. X 'V╜C[Nµ1],[0]VB[1+0<²2╟,S],[0](((²3+╞µD),N)µVL),[0]C[Nµ2]' 'D╜V,D'           °
  83. *(1996 4 6 16 9 6 228)                                                         °
  84.  FEXIT ÉFX 'EXIT' 'Σ Exit from function' '''To log off type:   )OFF'''         °
  85. X '╕'                                                                          °
  86. *(1996 4 6 16 9 6 228)                                                         °
  87.  FGO ÉFX 'GO;T;E;B' 'Σ Expression driver' 'L0:B╜E╜''''' 'æ╜''      '''         °
  88.   'T╜æ' '╕(^/'' ''=T)/L0' '╕((^/'')OFF ''=5╞6╟T)doif ''EXIT'')/0'              °
  89.   '╕(('':''εT)doif ''B╜evaldd (+/^\'''' ''''=T)╟T'')/L0'                       °
  90.   '''E╜ÉEM'' ÉEA T' '╕(0=µ,E)/L0' '╕B/L0'                                      °
  91.   '''This is not a valid APL2 expression''' 'æ╜''*'''                          °
  92. X '╕(''?''⌠╞1╟æ)/L0' 'E' '╕L0'                                                 °
  93. *(1997 9 8 12 23 46 460)                                                       °
  94.  FHELP ÉFX 'HELP;N;I;T' 'Σ Help to student' '''WHAT TO DO'',r'                 °
  95.   '''  ° To get out of the lesson''' '''       ENTER: EXIT'''                  °
  96.   '''  ° To log off APL2'''                                                    °
  97.   '''       FIRST, ENTER: EXIT  THEN ENTER: )OFF'''                            °
  98.   '''  ° To get help''' '''       ENTER: HELP'''                               °
  99.   '''  ° When you see the prompt on a blank line'''                            °
  100.   '''       ENTER AN APL2 EXPRESSION - OR JUST PRESS: ENTER''' 'do'            °
  101.   '''  ° If you get this line'',r'                                             °
  102.   '''This is not a valid APL2 expression'',r,''*'',r'                          °
  103.   '''        YOU CAN EITHER''' '''           A. PRESS: ENTER'''                °
  104.   '''           B. PRESS: ? and then ENTER to see what was incorrect'''        °
  105.   '''              in your expression causing that response'',r' 'do'          °
  106.   '''HINTS'',r'                                                                °
  107.   '''This lesson is made up of '',(«N╜7),'' components named TEACHx, whe       °
  108.  re''' '''the x stands for a digit:'',r' 'I╜0'                                 °
  109.   'L0:T╜''TEACH'',(«I╜I+1)' 'T,'' '',1╟notb(ÉCR T)[2;]' '╕(N>I)/L0'            °
  110.   'do'                                                                         °
  111.   '''You may review either of these components separately. To do that,''       °
  112.  '                                                                             °
  113.   '''first enter EXIT (and RETURN), then enter the name of the lesson.''       °
  114.  ' '''component (e.g. TEACH4).'',r'                                            °
  115.   '''To re-start the lesson, just enter TEACH'',r'                             °
  116.   '''When the screen fills up, it is a good idea to move the cursor to''       °
  117.  ' '''the start of a convenient paragraph, and press ENTER'',r'                °
  118.   '''You may also wish to press PAGE UP to review the prevous pages.'''        °
  119.   'do' '''RESOURCES'',r'                                                       °
  120.   '''You may also enter ONE of the following words at a time'',r'              °
  121.   '''COMMANDS   Summary of System Commands'''                                  °
  122. X '''BIND       A listing of binding rules''' 'endd'                           °
  123. *(1997 9 7 13 23 5 296)                                                        °
  124.  FTEACH ÉFX 'TEACH' 'Σ Start lesson #16: APL2 by Zdenek V JIZBA'               °
  125.   'exit ''TEACH''' 'initialize' 'TEACH1 Σ System commands'                     °
  126.   'TEACH2 Σ Index origin' 'TEACH3 Σ Local and global variables'                °
  127.   'TEACH4 Σ Adopting conventions'                                              °
  128.   'TEACH5 Σ Sample utility functions "do"'''                                   °
  129.   'TEACH6 Σ Utility functions "show" and "showfn"'                             °
  130. X 'TEACH7 Σ System functions and System variables' 'problems'                  °
  131. *(1997 7 9 14 11 40 392)                                                       °
  132.  FTEACH1 ÉFX 'TEACH1' 'Σ Discuss System Commands'                              °
  133.   '''In the previous lesson we saw examples of nested data structures'''       °
  134.   '''and their use. We defined a number of functions that performed'''         °
  135.   '''interesting tasks. We also learned about APL2 idioms, and how one''       °
  136.  '                                                                             °
  137.   '''can find specific idioms with workspace IDIOMS provided by IBM.'''        °
  138.   'do' '''      SYSTEM COMMANDS'',r'                                           °
  139.   '''In this lesson we will study SYSTEM COMMANDS. These are expressions       °
  140.  '''                                                                           °
  141.   '''that begin with a right parenthesis. System commands are NOT part o       °
  142.  f'''                                                                          °
  143.   '''the APL language and cannot be included in user defined functions.'       °
  144.  ''                                                                            °
  145.   '''When you enter these commands such as )LOAD ... it is not the APL''       °
  146.  ' '''processor that evaluates them. Instead the ")" tells the APL'''          °
  147.   '''processor to transfer the expression to the system under which APL'       °
  148.  '' '''is evaluated.''' 'do'                                                   °
  149.   '''Before we introduce new (and old) System commands, heed this warnin       °
  150.  g!'',r'                                                                       °
  151.   '''       WHILE IN THIS LESSON, YOU CANNOT ISSUE SYSTEM COMMANDS.'''         °
  152.   '''       ON COMPLETION OF THE LESSON YOU MAY PRACTICE, BUT BE SURE'''       °
  153.   '''       TO HAVE BACKUP COPIES OF ALL TEACH* WORKSPACES. IF YOU'''          °
  154.   '''       ARE CARELESS, YOU MAY EASILY DESTROY YOUR SOFTWARE.'',r'           °
  155.   'do'                                                                         °
  156.   '''You should be already quite familiar with the following commands,''       °
  157.  ,r' '''      )LOAD workspace     --or )IN workspace'''                        °
  158.   '''      )OFF'''                                                             °
  159.   '''We will introduce here many, but not all System Commands available        °
  160.  to APL2''' 'do' '''    WORKSPACE NAME'',r'                                    °
  161.   '''Once a workspace is loaded, you can rename it by'''                       °
  162.   '''      )WSID newname'''                                                    °
  163.   '''If you have forgotten the current name of the workspace, then )WSID       °
  164.  ''' '''with no argument will provide that name.''' 'do'                       °
  165.   '''     COPYING FROM A WORKSPACE FILE'',r'                                   °
  166.   '''If you desire to copy into the active workspace the contents of all       °
  167.   or'''                                                                        °
  168.   '''only a few selected APL2 objects (variables, functions or operators       °
  169.  )''' '''then enter''' '''     )COPY ws'''                                     °
  170.   '''     )COPY ws object1 [object2 ..]'''                                     °
  171.   '''In the first form, all objects from the named workspace will be cop       °
  172.  ied'''                                                                        °
  173.   '''into the currently active workspace. In the second form, only the''       °
  174.  '                                                                             °
  175.   '''named objects will be copied. (The brackets indicate that you may c       °
  176.  opy''' '''more than one object at a time.)'''                                 °
  177.   '''If the workspace to be copied is in the ATF format (ATF stands for        °
  178.  "APL''' '''Transfer Format"), then the commands should be'''                  °
  179.   '''      )IN ws''' '''      )IN ws object1 [object2 ..]'''                   °
  180.   '''If you wish to copy from a workspace in such a way that currently a       °
  181.  ctive'''                                                                      °
  182.   '''objects are NOT over-riden, then the corresponding commands are'''        °
  183.   '''      )PCOPY ws''' '''      )PIN ws'''                                    °
  184.   '''      )PCOPY ws object1 [object2 ..]'''                                   °
  185.   '''      )PIN ws object1 [object2]'''                                        °
  186.   '''To find out what workspaces are available, enter'''                       °
  187.   '''      )LIB [#]'''                                                         °
  188.   '''If a library # is given, only the workspaces stored in that library       °
  189.  '''                                                                           °
  190.   '''will be listed. To see the contents of your private library, enter'       °
  191.  '' '''just )LIB.''' 'do' '''     SAVING A WORKSPACE'',r'                      °
  192.   '''To store an active workspace, you can enter''' '''     )SAVE'''           °
  193.   '''      WARNING! ANY PREVIOUS WORKSPACE WITH THIS NAME WILL BE LOST!'       °
  194.  ',r'                                                                          °
  195.   '''If you wish to store the workspace under another name, you may ente       °
  196.  r''' '''     )SAVE wsid'''                                                    °
  197.   '''If you wish to save the active workspace in the ATF format, then en       °
  198.  ter''' '''     )OUT ws'''                                                     °
  199.   '''On occasion you may wish to temporarily save a workspace in such a        °
  200.  way'''                                                                        °
  201.   '''that on entering APL2 the next time, that same workspace will be'''       °
  202.   '''automatically re-loaded, and any interrupted execution can be resum       °
  203.  ed.''' '''To do that, enter''' '''     )CONTINUE''' 'do'                      °
  204.   '''      DELETING APL2 OBJECTS'',r'                                          °
  205.   '''If you decide to erase one or more APL2 objects from the workspcae,       °
  206.  ''' '''you can enter''' '''     )ERASE object1 [OBJECT2 ..]'''                °
  207.   '''You can also delete an entire workspace'''                                °
  208.   '''      WARNING! The following command should be used with caution.''       °
  209.  ' '''               If in doubt, maintain adequate backup.'''                 °
  210.   '''      )DROP workspace'''                                                  °
  211.   '''This command eliminates a workspace. It is equivalent to the DOS'''       °
  212.   '''command: ERASE file'''                                                    °
  213.   '''If you want to erase your active workspace then enter'''                  °
  214.   '''      )CLEAR''' '''The workspace name becomes CLEAR''' 'do'               °
  215.   '''      CONTENTS OF ACTIVE WORKSPACE'',r'                                   °
  216.   '''To find out what objects exist in the workspace, there are four'''        °
  217.   '''Systems commands: )NMS, )VARS, )FNS and )OPS. )NMS will list ALL'''       °
  218.   '''objects in the workspace. The name is followed by a period and an''       °
  219.  '                                                                             °
  220.   '''integer: (2=variable, 3=function, 4=defined operator). )VARS will''       °
  221.  '                                                                             °
  222.   '''list only the names of active variables. )FNS will list only define       °
  223.  d''' '''functions, and )OPS will list all defined operators.''' 'do'          °
  224.   '''      EXECUTION STATUS'',r'                                               °
  225.   '''If you have interrupted the execution of a defined function, that''       °
  226.  '                                                                             °
  227.   '''execution remains in suspension. You can find out the status by'''        °
  228.   '''    )SI''' '''    )SINL       --or''' '''    )SIS'''                      °
  229.   '''These commands will produce a listing of suspended functions. To'''       °
  230.   '''re-enter the execution, you can branch to the line number of the'''       °
  231.   '''first (top) line of the list'',r'                                         °
  232.   '''To remove suspended execution, you can enter'''                           °
  233.   '''    )RESET #   --or its synonym--  )SIC #'''                              °
  234.   '''If a number is given, only the number of most recent suspensions wi       °
  235.  ll''' '''be removed from the top of the state indicator list.''' 'do'         °
  236.   '''      OTHER SYSTEM COMMANDS'',r'                                          °
  237.   '''If you get an error message, there is a command you can give to obt       °
  238.  ain''' '''more information''' '''    )MORE'''                                 °
  239.   '''Most (if not all) of the time APL2OS2 will print: NO MORE INFORMATI       °
  240.  ON''' 'do' '''    )HOST (OS2-dos)-command'''                                  °
  241.   '''The above expression allows you to send a message to the operating'       °
  242.  ''                                                                            °
  243.   '''system (e.g. "dir a:"). To see the results, however, you have to'''       °
  244.   '''press Ctrl-ESC and select the APL2OS2 window.''' 'do'                     °
  245.   '''If you have problems with the execution, you might try'''                 °
  246.   '''     )CHECK ...    --see Language reference for options''' 'do'           °
  247.   '''If you get a message that your SYMBOL TABLE is full, you can invoke       °
  248.  ''' '''     )SYMBOLS [size]''' 'do'                                           °
  249.   '''Some other System Commands are not listed here because they have'''       °
  250.   '''meaning only in non-PC APL2 software.'''                                  °
  251.   '''To see all available System commands, enter COMMANDS. This function       °
  252. X''' '''tabulates all System commands supported by APL2OS2.''' 'endd'          °
  253. *(1997 7 10 12 23 55 496)                                                      °
  254.  FTEACH2 ÉFX 'TEACH2;FOO;VAR' 'Σ Index origin'                                 °
  255.   '''      INDEX ORIGIN'',r'                                                   °
  256.   '''If you decide to use functions developed by someone else, then it i       °
  257.  s'''                                                                          °
  258.   '''only natural to inquire whether those functions (or operators) are'       °
  259.  ''                                                                            °
  260.   '''compatible with yours. There is one major source of incompatibility       °
  261.  .'''                                                                          °
  262.   '''It is a System Variable called the INDEX ORIGIN (ÉIO). ÉIO may be''       °
  263.  ' '''assigned a boolean value.''' 'do'                                        °
  264.   '''Up to now we have been using index origin 1. This means that the co       °
  265.  unt'''                                                                        °
  266.   '''begins with 1. Some programmers prefer to begin counting with 0'',r       °
  267.  ' 'show ''∞5'' ''ÉIO╜0'' ''∞5'' ''ÉIO╜1'''                                    °
  268.   '''Using one index origin on data (or functions) defined in another'''       °
  269.   '''index origin can lead to problems'',r'                                    °
  270.   'show ''ÉIO'' ''(∞5)[5]'' ''ÉIO╜0'' ''(∞5)[5]'' ''(∞5)[4]'' ''ÉIO╜1'''       °
  271.   '''If software development is done in an environment where defined'''        °
  272.   '''functions are "borrowed" from other applications, then precautions'       °
  273.  '' '''should be taken to avoid such conflicts.''' 'do'                        °
  274.   '''How does one do that?'',r'                                                °
  275.   '''One way would be to define index origin as a local variable, and se       °
  276.  t''' '''it to whatever is the desired value:'',r'                             °
  277.   'show ''ÉFX ''''FOO W;ÉIO'''' ''''Σ Index Origin is local'''' ''''ÉIO╜       °
  278.  0'''' ''''∞W''''''' '1 showfn ''FOO''' 'show ''∞5'' ''FOO 5'' ''∞5'''         °
  279.   '''Another way is to make sure that expressions are "index origin'''         °
  280.   '''independent":'',r'                                                        °
  281.   'show ''VAR╜∞5'' ''ÉIO╜0'' ''VAR[ÉIO+0 2]'' ''ÉIO╜1'' ''VAR[ÉIO+0 2]''       °
  282.  '                                                                             °
  283.   '''In this expression no matter what the index origin, the contents of       °
  284.  ''' '''brackets return the first and third element of VAR.''' 'do'            °
  285.   '''The problem of index origin seldom comes up in practice. But when i       °
  286.  t'''                                                                          °
  287.   '''does, it may be very baffling. To see this, just set the index orig       °
  288.  in'''                                                                         °
  289.   '''to zero, exit from this lesson, and re-enter it with TEACH.'''            °
  290.   'do'                                                                         °
  291.   '''If you write code for use by other APL2 programmers, it is good adv       °
  292.  ice'''                                                                        °
  293.   '''to make it ÉIO independent. On the other hand, if you write APL2 co       °
  294.  de'''                                                                         °
  295.   '''mostly for yourself, it may not be worth the extra effort. As a mat       °
  296.  ter'''                                                                        °
  297.   '''of fact, the majority of APL2 programmers appear to use index origi       °
  298.  n'''                                                                          °
  299.   '''of ONE. On the other hand J programmers are limited to index origin       °
  300. X 0.''' 'endd'                                                                 °
  301. *(1997 7 10 12 53 6 420)                                                       °
  302.  FTEACH3 ÉFX 'TEACH3;MEANING' 'Σ Discuss the role of global variables'         °
  303.   '''     USING GLOBAL VARIABLES'',r'                                          °
  304.   '''Another source of potential problems comes from the use of GLOBAL''       °
  305.  ' '''VARIABLES. The advantage of having global variables is their'''          °
  306.   '''availability to all defined functions. This can also be a great'''        °
  307.   '''disadvantage.'',r'                                                        °
  308.   '''How does one decide what variables should be global?''' 'do'              °
  309.   '''   1. There may be variables to define the workspace environment:''       °
  310.  ,r'                                                                           °
  311.   '''If some functions are sensitive to the hardware setup, then it migh       °
  312.  t'''                                                                          °
  313.   '''be a good idea to place this information into one or more globals.'       °
  314.  ''                                                                            °
  315.   '''For example, in some applications it is important to know the name        °
  316.  of''' '''the partition (C:, D:...) where certain files reside.''' 'do'        °
  317.   '''   2. Another reason for storing data in a globals is if it is'''         °
  318.   '''      frequently referenced, by several functions.'',r'                   °
  319.   'show ''dig'' ''lc'' ''uc'''                                                 °
  320.   '''Variables ''''dig'''', ''''lc'''' and ''''uc'''' contain numeric di       °
  321.  gits, lower'''                                                                °
  322.   '''and upper case letters. These characters could be extracted from th       °
  323.  e''' '''atomic vector, but dig, uc and lc is easier to remember'''            °
  324.   'do'                                                                         °
  325.   '''   3. Some special symbols may not be readily accessible from the''       °
  326.  ' '''      keyboard'',r'                                                      °
  327.   '''Look at the left hand tabulations of symbols when you select the'''       °
  328.   '''"Modify keyboard" from the Options pull down menu.''' 'do'                °
  329.   '''   4. When a variable is passed to a function as a right or left'''       °
  330.   '''      argument, a separate copy may have to be made. If that'''           °
  331.   '''      variable takes up a great deal of storage, valuable resources       °
  332.  ''' '''      may be wasted.'',r'                                              °
  333.   '''We saw an example of that when we defined a rule based Expert Syste       °
  334.  m.'''                                                                         °
  335.   '''We stored nested arrays ANTE, CONS, FACTS and GOALS as globals.'''        °
  336.   'do'                                                                         °
  337.   '''Working with globals also causes problems.  For example, suppose we       °
  338.  '''                                                                           °
  339.   '''decide to name a global: X.  Then if a defined function names X as'       °
  340.  ''                                                                            °
  341.   '''local, the global name is not accessible to that function. This may       °
  342.  '''                                                                           °
  343.   '''not only lead to trouble, but also to difficulties in figuring out        °
  344.  what''' '''is wrong when things do not work the way we expect them.'''        °
  345.   'do'                                                                         °
  346.   '''Another problem comes up when a utility is copied into a workspace.       °
  347.  '''                                                                           °
  348.   '''If that utility calls on global variables or functions either not i       °
  349.  n'''                                                                          °
  350.   '''the workspace or incompatible, then there will be problems. One'''        °
  351.   '''solution to these problems is to adopt simple and reasonable naming       °
  352. X''' '''conventions.''' 'endd'                                                 °
  353. *(1997 7 10 13 21 35 412)                                                      °
  354.  FTEACH4 ÉFX 'TEACH4' 'Σ Using conventions' '''ADOPTING CONVENTIONS'',r'       °
  355.   '''One problem with conventions is that not everyone uses the same one       °
  356.  s.'''                                                                         °
  357.   '''If you build your own applications, it is always a good idea to hav       °
  358.  e''' '''some sort of naming conventions.''' 'do'                              °
  359.   '''For example in these lessons, all utility functions (and operators)       °
  360.  '''                                                                           °
  361.   '''as well as all global variables have been defined as lower case nam       °
  362.  es.'''                                                                        °
  363.   '''Here is an example on how you may take advantage of that convention       °
  364.  .'''                                                                          °
  365.   '''Suppose you wish to develop a new workspace, and wish to use all'''       °
  366.   '''previously available utilities. You can load an existing workspace'       °
  367.  '' '''containing the following utility'',r' '1 showfn ''erase''' 'do'         °
  368.   '''Ignoring for now the upper case labels in the header, the function'       °
  369.  '' '''invokes the system command ÉNL which stands for Name List'',r'          °
  370.   'show ''Γ[2]ÉNL 2'''                                                         °
  371.   '''In the example, the right argument of 2 calls for a list of all'''        °
  372.   '''global variables (as well as any local variables in the currently''       °
  373.  '                                                                             °
  374.   '''active function). A 3 would list all functions, and a 4 would list'       °
  375.  '' '''all defined operators.'',r'                                             °
  376.   '''Function "erase" first generates a list of all functions.'''              °
  377.   '''Then it erases (using ÉEX) all but those that are in lower case.'''       °
  378.   '''It repeats the process for all variables and all defined operators.       °
  379.  '',r'                                                                         °
  380.   '''What you have left in the workspace is only the utilities (and you'       °
  381.  '' '''better rename the workspace before you save it).''' 'do'                °
  382.   '''Actually, in the sample function, there are additional features.'',       °
  383.  r'                                                                            °
  384.   ''' 1. All functions beginning with the word TEACH are also saved'',r'       °
  385.   ''' 2. All names listed in the header are made local, and therefore'''       °
  386.   '''    will not be listed with ÉNL.'',r'                                     °
  387.   '''With these two schemes it is possible to clean out a TEACH workspac       °
  388.  e'''                                                                          °
  389.   '''of any sample functions or variables generated by a student. (This        °
  390.  is'''                                                                         °
  391.   '''why at the start of each tutorial, a message requests the student t       °
  392.  o''' '''press the Caps Lock key.)''' 'do'                                     °
  393.   '''A given set of conventions may not be adequate for everyone. For'''       °
  394.   '''example, Harry Bertucelli''''s workspaces distinguished user define       °
  395.  d'''                                                                          °
  396.   '''functions from user defined operators. Functions were named in uppe       °
  397.  r'''                                                                          °
  398.   '''case and operators in lower case. In early versions of APL, defined       °
  399.  '''                                                                           °
  400.   '''functions were documented in functions of the same name, but with''       °
  401.  '                                                                             °
  402.   '''the added ending HOW. Whatever conventions are adopted, it is a goo       °
  403.  d'''                                                                          °
  404.   '''idea to have a workspace, a global variable, or a niladic function'       °
  405. X'' '''that explains these conventions.''' 'endd'                              °
  406. *(1997 7 10 13 25 2 296)                                                       °
  407.  FTEACH5 ÉFX 'TEACH5;A' 'Σ Describe three utility functions'                   °
  408.   '''Let us take a look at other utility functions in this workspace. We       °
  409.  '''                                                                           °
  410.   '''begin with function "do". This function simulates the APL2 prompt,'       °
  411.  '' '''and accepts valid APL2 expressions as well as well as Direct'''         °
  412.   '''Definitions (which are not valid under APL2).''' 'do'                     °
  413.   '1 showfn ''do''' 'do'                                                       °
  414.   '''Lines [3] and [4] simulate the effect of APL when waiting for user'       °
  415.  ''                                                                            °
  416.   '''input.  This input is captured, and if it contains only blanks [5],       °
  417.   the'''                                                                       °
  418.   '''function exits. If the expression contains a colon [6], consider it       °
  419.   to'''                                                                        °
  420.   '''be a direct definition. Evaluate the expression with a utility func       °
  421.  tion'''                                                                       °
  422.   '''called "evaldd". Otherwise attempt to evaluate it using the ÉEA'''        °
  423.   '''System Function. If this succeeds, return to line [2] to capture'''       °
  424.   '''another expression from the keyboard.''' 'do'                             °
  425.   '''If the attempt fails, capture the error message in local variable E       °
  426.  ,''' '''and display the message'',r'                                          °
  427.   '''    This is not a valid APL2 expression''' '''    *'',r'                  °
  428.   '''If the next keyboard entry is a ?, then the error message (in E) wi       °
  429.  ll'''                                                                         °
  430.   '''be displayed. Else the function returns to the next APL2 prompt.'''       °
  431.   'do'                                                                         °
  432.   '''Function "do" is used within the lessons to allow the student'''          °
  433.   '''to enter APL2 expressions without interrupting the tutorial.'''           °
  434. X 'endd'                                                                       °
  435. *(1997 7 10 13 47 32 504)                                                      °
  436.  FTEACH6 ÉFX 'TEACH6' 'Σ Function show and showfn'                             °
  437.   '''There are two more utility functions of interest: "show" and'''           °
  438.   '''"showfn". The first function simulates a keyboard entry'''                °
  439.   '''followed by the result of that entry. It is used in the lessons to'       °
  440.  ''                                                                            °
  441.   '''display examples under discussion. Function "showfn" displays a'''        °
  442.   '''user defined function as if it were requested with the Del mode.'',       °
  443.  r' '''Here is the listing of these two functions.''' 'do'                     °
  444.   '1 showfn ''show''' 'do' '1 showfn ''showfn''' 'do'                          °
  445.   '''NOTE: These two functions invoke "doif" a utlity that was designed'       °
  446.  ''                                                                            °
  447.   '''under TRYAPL2 at a time when the diamond (╪) was not available. You       °
  448.  '''                                                                           °
  449.   '''may also look at this utility. I have left it in place partially'''       °
  450.   '''because it does not do any harm. In execution it is 2⌡slower than''       °
  451.  ' '''the diamond''' 'do'                                                      °
  452.   '''Now, evaluate the following two expressions:'',r'                         °
  453.   '''    show ''''∞5''''      and'',r,''  1 showfn ''''addquote'''''',r'       °
  454.   '''Can you explain the purpose of the left argument to showfn?'''            °
  455. X 'endd'                                                                       °
  456. *(1997 9 19 12 39 30 504)                                                      °
  457.  FTEACH7 ÉFX 'TEACH7' 'Σ System Functions and System Variables'                °
  458.   '''   SYSTEM FUNCTIONS AND SYSTEM VARIABLES'',r'                             °
  459.   '''There are several System functions and System variables that'''           °
  460.   '''provide information and functionality to APL2. We will list here'''       °
  461.   '''those that appear to be supported by APL2OS2. (For additional ones,       °
  462.  ''' '''see the language reference manual.)'',r'                               °
  463.   '''   LATENT EXPRESSION'',r'                                                 °
  464.   '''When you load a workspace such as one of these tutorials, the lesso       °
  465.  n'''                                                                          °
  466.   '''begins without any prompting by you. This happens because on loadin       °
  467.  g'''                                                                          °
  468.   '''the workspace, an APL2 expression has been defined as LATENT'''           °
  469.   '''with the command ÉLX'',r' 'show ''ÉLX'''                                  °
  470.   '''The latent expression "TEACH" has been defined on all workspaces of       °
  471.  '''                                                                           °
  472.   '''this tutorial; however for workspaces UTILITY and INDEX it is "lx".       °
  473.  '''                                                                           °
  474.   '''When a workspace is retrieved using the ")IN ..." system command,''       °
  475.  '                                                                             °
  476.   '''the latent expression, if it exists, is also retrieved but is not''       °
  477.  ' '''evaluated.''' 'do'                                                       °
  478.   '''    INFORMATION ABOUT THE WORKSPACE ENVIRONMENT'',r'                      °
  479.   '''There are several System functions and System commands that give'''       °
  480.   '''information about the APL2 session, and about the workspace:'',r'         °
  481.   '''ACCOUNT INFORMATION (ÉAI) is a variable that cannot be assigned. It       °
  482.  '''                                                                           °
  483.   '''gives information about the user identification (1001 if only one''       °
  484.  '                                                                             °
  485.   '''APL2 session is active), compute time, duration of the session, and       °
  486.  ''' '''user response time. (Times are in miliseconds)'',r'                    °
  487.   'show ''ÉAI'''                                                               °
  488.   '''COMPARISON TOLERANCE (ÉCT) is a variable. Its contents (default is'       °
  489.  ''                                                                            °
  490.   '''1E²13) determine whether two quantities will be treated as the same       °
  491.  .'''                                                                          °
  492.   '''It is also used in other contexts to determine whether a value shou       °
  493.  ld''' '''treated as an integer'',r'                                           °
  494.   'show ''2=2+1E²14 ╪ 2=2+1E²12 ╪ 2+1E²14'''                                   °
  495.   '''DELAY (ÉDL) is a function. The right argument is the number of seco       °
  496.  nds.'''                                                                       °
  497.   '''APL2 processing is suspended for that length of time. The function'       °
  498.  '' '''returns the time of suspension.'',r' 'show ''ÉDL 2'''                   °
  499.   '''PRINT PRECISION (ÉPP) is a variable. Its value (default is 10)'''         °
  500.   '''determines the number of significant digits to be displayed'',r'          °
  501.   'show ''ÉPP ╪ *1 ╪ ÉPP╜16 ╪ *1 ╪ ÉPP╜5 ╪ *1 ╪ ÉPP╜10'''                      °
  502.   '''PRINTING WIDTH (ÉPW) is a variable. In the options pull down menu,        °
  503.  you'''                                                                        °
  504.   '''can select under "Font" the font size. The available ranges are'''        °
  505.   '''8,10,(12),14,18,24. You can accomodate the printing width of APL2 t       °
  506.  ext''' '''using this variable. Default is 79.'',r'                            °
  507.   'show ''ÉPW ╪ ÉPW╜30 ╪ 40µuc ╪ ÉPW╜120 ╪ 120µuc ╪ ÉPW╜79'''                  °
  508.   '''WORKSPACE AVAILABLE (ÉWA) is a variable that cannot be set. When'''       °
  509.   '''invoked, it gives the number of free bytes available in the workspa       °
  510.  ce'',r' 'show ''ÉWA'''                                                        °
  511.   '''Other System functions and variables are described in separate tuto       °
  512.  rials'''                                                                      °
  513. X '''dealing with Shared Variables and Auxilliary Processors.''' 'endd'        °
  514. *(1997 7 13 12 28 49 504)                                                      °
  515.  Faddquote ÉFX 'u╜addquote w'                                                  °
  516.   'Σ Put quotes around a string, and double existing quotes'                   °
  517. X 'u╜ÉAV[40],((1+w=ÉAV[40])/w),ÉAV[40]'                                        °
  518. *(1997 7 24 13 20 38 476)                                                      °
  519.  Fav ÉFX 'av;A;N;I;ÉIO' 'Σ Display characters in ÉAV' 'ÉIO╜0'                  °
  520.   'A╜22 78µ'' ''' 'N╜3 0«φ12 22µ1+∞356' 'A[;,(6⌡∞12)°.+2 3 4]╜N'               °
  521.   'A[;6+6⌡∞12]╜φ12 22µÉAV' 'ΣA[8 10 13;6]╜'' ''' 'A[13;6]╜'' '''               °
  522. X 'A[14+∞8;68 69 70 72]╜'' ''' 'A'                                             °
  523. *(1991 11 11 8 25 13 316)                                                      °
  524.  Fdate ÉFX 'u╜date w' 'Σ Format date and time of day' 'u╜«6╞w'                 °
  525. X 'u╜('' ''⌠u)Γu' 'u╜εu,■''-- .. '''                                           °
  526. XCdig 1 10 1234567890                                                          °
  527. *(1997 9 9 13 0 45 372)                                                        °
  528.  Fdisclaimer ÉFX 'disclaimer' 'Σ Copyright statement'                          °
  529.   '(10µ'' ''),''Copyright, Z. V. Jizba, 1995,1996,1997'',r'                    °
  530.   ''' This and subsequent workspaces labelled TEACHxx are made available       °
  531.  '''                                                                           °
  532.   '''at no cost to anyone who desires to learn how to use effectively'''       °
  533.   '''the IBM/OS2 version of APL2.'',r'                                         °
  534.   '''This software is provided "AS IS" with no WARRANTY of any kind, eit       °
  535.  her'''                                                                        °
  536.   '''express or implied. Any risk in its use resides with you, the user        °
  537.  of''' '''these tutorials.'',r' '''     ACKNOWLEDGEMENTS'',r'                  °
  538.   ''' In writing these tutorials, I am greatly indebted to Roy Sykes, wh       °
  539.  ose'''                                                                        °
  540.   '''excellent lectures increased my understanding of the language.'''         °
  541.   '''Discussions with the late Harry Bertucelli clarified a number of'''       °
  542.   '''concepts and caused me to change some improper terminology that was       °
  543.  '''                                                                           °
  544.   '''used in previous versions of these tutorials. Mr. Benjamin Archer''       °
  545.  '                                                                             °
  546.   '''kindly checked out a nearly final version, bringing to my attention       °
  547.  ''' '''some ommisions, misspellings, and invalid terminology.'',r'            °
  548. X '''(PRESS ENTER to continue)'''                                              °
  549. *(1997 7 13 12 28 50 508)                                                      °
  550.  Fdo ÉFX 'do;T;E' 'Σ Expression driver' 'E╜''''' 'æ╜''      ''' 'T╜æ'          °
  551.   '╕(^/'' ''=T)/0'                                                             °
  552.   '╕(('':''εT)doif ''B╜evaldd (+/^\'''' ''''=T)╟T'')/2'                        °
  553.   '''E╜ÉEM'' ÉEA T' '╕(0=µ,E)/2'                                               °
  554.   '''This is not a valid APL2 expression''' 'æ╜''*''' '╕(''?''⌠╞1╟æ)/2'        °
  555. X 'E' '╕2'                                                                     °
  556. *(1997 7 13 12 28 50 508)                                                      °
  557.  Fdoif ÉFX 'U╢╜V╢ doif W╢;t╢' 'Σ Rule' '╕(^/~U╢╜V╢)/0'                         °
  558. X '''U╢╜V╢ doif■ W╢'' ÉEA ''»V╢/W╢'''                                          °
  559. *(1997 9 9 12 50 14 444)                                                       °
  560.  Fendd ÉFX 'endd' 'Σ end of special feature' '20µ''²'' ╪ ╕(4<µÉLC)/0'          °
  561. X 'do'                                                                         °
  562. *(1997 8 18 12 43 8 424)                                                       °
  563.  Ferase ÉFX                                                                    °
  564.   'erase;t;EXIT;GO;HELP;DISPLAY;BIND;REVIEW;RULE;COMMANDS;DISCLAIMER'          °
  565.   'Σ Erase all extraneous global functions and variables' 't╜ÉNL 3'            °
  566.   't╜(~t^.εlc,'' '')≡t' 't╜ÉEX(~t[;∞5]^.=''TEACH'')≡t' 't╜ÉNL 2'               °
  567. X 't╜ÉEX(~t^.εlc,'' '')≡t' 't╜ÉNL 4' 't╜ÉEX(~t^.εlc,'' '')≡t'                  °
  568. *(1997 7 27 13 47 41 608)                                                      °
  569.  Fevaldd ÉFX 'u╜evaldd w;c;n' 'Σ Evaluate direct definition' 'u╜0'             °
  570.   'n╜(w∞''Σ'')-1' 'c╜(((n╞w)⌠'':'')Γn╞w),Γ''ΣDD '',(n+1)╟w'                    °
  571.   '╕((1 label╞c)doif ''''''Invalid label'''''')/0'                             °
  572.   '╕((2=µc)doif ''u╜showdd 1╙c'')/0'                                           °
  573.   '╕((3=ÉNC╞c)doif ''u╜⌡µÉ╜(╞c),'''' is already defined.'''''')/0'             °
  574.   '╕((3=µc)doif ''u╜simdd c'')/0' 'c╜(Γ''α∙ aw'')replace■c'                    °
  575.   'u╜ε''u╜'',((''a''εεc[2 3 4])/''a ''),(╞c),'' w;t;b'''                       °
  576.   'u╜u(5πc)(''b╜(t╜'',(3πc),'')/'',addquote ''u╜'',4πc)'                       °
  577. X 'u╜u,''╕(t doif b)/0''(''u╜'',2πc)' 'u╜╧ÉFX u'                               °
  578. *(1997 7 25 13 27 52 564)                                                      °
  579.  Fexit ÉFX 'V exit W;T' 'Σ Exit if too many suspended functions'               °
  580.   '╕(0⌠ÉNC ''V'')/L0 ╪ V╜10' 'L0:╕(V>µÉLC)/0'                                  °
  581.   '''There are too many suspended functions''' '''Please enter '',W'           °
  582. X '╕'                                                                          °
  583. *(1997 7 26 12 33 39 536)                                                      °
  584.  Fget ÉFX 'U╜V get W;t;T;ÉPR' 'Σ Prompt for response from keyboard'            °
  585.   'ÉPR╜T╜ÉAV[ÉIO+255] ╪ ╕(0⌠ÉNC ''V'')/L0 ╪ V╜1' 'L0:V╜V╧1' 'æ╜W ╪ t╜æ'        °
  586.   'U╜(+/^\t=T)╟t' '╕(''╕''⌠╞U)/L1 ╪ ╕' 'L1:╕V/0' 't╜(U⌠'' '')ΓU'               °
  587. X 'U╜(µt),(ΓU),t'                                                              °
  588. *(1997 7 28 13 33 8 424)                                                       °
  589.  Fglobals ÉFX 'globals' 'Σ Initialize useful global variables'                 °
  590.   'uc╜''ABCDEFGHIJKLMNOPQRSTUVWXYZ'''                                          °
  591.   'lc╜''abcdefghijklmnopqrstuvwxyz''' 'dig╜''1234567890'''                     °
  592. X 'r╜ÉAV[13+ÉIO]' 'q╜'''''''''                                                 °
  593. *(1997 7 3 12 47 6 368)                                                        °
  594.  Finitialize ÉFX 'initialize;T' 'Σ Initialize workspace'                       °
  595.   '''AT ALL TIMES, TO CONTINUE, PRESS RETURN!'',r'                             °
  596.   '''To see disclaimers enter:'',r,''    disclaimer''' 'do' 'erase'            °
  597.   'globals'                                                                    °
  598.   '''Make sure the CAP LOCK light on your keyboard (upper right) is ON!'       °
  599. X'' 'endd'                                                                     °
  600. *(1997 7 27 13 14 33 444)                                                      °
  601.  Flabel ÉFX 'u╜v label w'                                                      °
  602.   'Σ Return 1 if label w does not begin with a cap'                            °
  603.   '╕(0⌠ÉNC ''v'')/L0 ╪ v╜0' 'L0:v╜v╧1 ╪ w╜εw ╪ ╕v/L1 ╪ ╕(u╜0⌠ÉNC w)/0'         °
  604. X 'L1:╕(u╜~^/wεlc,uc,dig)/0' 'u╜w[1]εlc,dig'                                   °
  605. XClc 1 26 abcdefghijklmnopqrstuvwxyz                                           °
  606. *(1997 7 13 12 28 55 528)                                                      °
  607.  Fnon ÉFX 'non;T;RC;ET;R' 'Σ Ignore keyboard entry' 'æ╜''      ''' 'T╜æ'       °
  608.   '╕(0=µ(T⌠'' '')/T)/0' '(RC ET R)╜ÉEC T' '╕(0=RC)/2'                          °
  609. X '╕((1=RC)doif ''R'')/2' '╕2'                                                 °
  610. *(1997 7 13 12 28 55 528)                                                      °
  611.  Fnotb ÉFX 'u╜notb w' 'Σ Remove trailing blanks'                               °
  612.   '╕((1<╧w)doif ''u╜notb■ w'')/0' '╕((1<µµw)doif ''u╜πnotb Γ[2]w'')/0'         °
  613. X 'u╜(1-(,'' ''⌠Φw)∞1)╟w'                                                      °
  614. *(1997 7 27 12 55 6 496)                                                       °
  615.  Fproblems ÉFX 'problems' 'Σ Problems'                                         °
  616.   '''That is all for this lesson. Remember, if you want to practice,'''        °
  617.   '''and plan to use direct definitions, be sure to first enter GO.'''         °
  618.   '''Direct definitions will then be accepted. To exit GO, enter EXIT.''       °
  619.  ,r'                                                                           °
  620.   '''To erase a previously defined DIRECT DEFINITION FUNCTION, enter'',r       °
  621.  ' '''       )ERASE functionname'',r'                                          °
  622. X '''WARNING! do not use )ERASE on other labels.'',r'                          °
  623. XCq 0 '                                                                        °
  624. XCr 0                                                                         °
  625. *(1997 7 13 12 28 56 532)                                                      °
  626.  Freplace ÉFX 'u╜v replace u;i;r;s' 'Σ Replace elements in v in u'             °
  627.   'i╜Γ∞µu' 's╜2πv╜(v⌠'' '')Γv' 'i╜⌡r╜i⌡■Γ[1]u°.=╞v'                            °
  628. X 'u[(εi)/εr]╜s[(εi)/εi⌡■∞µs]'                                                 °
  629. *(1997 7 13 12 28 56 532)                                                      °
  630.  Fround ÉFX 'U╜V round W' 'Σ Half adjust to V th decimal'                      °
  631. X 'U╜(╛0.5+W⌡10*V)÷10*V'                                                       °
  632. *(1997 7 13 12 28 57 536)                                                      °
  633.  Fshow ÉFX '╢V show ╢W;╢T;╢B' 'Σ Display and execute ╢W'                       °
  634.   '╢T╜(0=ÉNC ''╢V'')doif ''╢V╜0'''                                             °
  635.   '╕((0=╧╢W)doif ''show ╢W,'''' '''''')/0'                                     °
  636.   '╕((1<╧╢W)doif ''╢V show ■╢W'')/0' '''      '',╢W'                           °
  637. X '╕((╢V^'':''ε╢W)doif ''╢T╜evaldd ╢W'')/L0' '''ÉEM'' ÉEA ╢W' 'L0:do'          °
  638. *(1997 7 13 12 28 57 536)                                                      °
  639.  Fshowdd ÉFX 'u╜showdd w;a;b;c;r'                                              °
  640.   'Σ Display a direct definition function'                                     °
  641.   '╕((1=╧w)doif ''u╜showdd Γw'')/u╜0'                                          °
  642.   '╕((3⌠ÉNC╞w)doif ''(ε╞w),'''' is not a function'''''')/0'                    °
  643.   'c╜Γ[2]ÉCR╞w' 'c╜notb(2╞c),(Γ''aw α∙'')replace■2╟c'                          °
  644.   '╕((~''ΣDD''╧3╞2πc)doif ''''''Not a direct definition function'''''')/       °
  645.  0' 'u╜1' 'b╜('' ''⌠╞c)Γ╞c' 'a╜''      ''' 'r╜2╟3πc'                           °
  646.   '╕((3=µc)doif ''a,(╞w),'''':'''',r,(3<µ2πc)/''''   Σ'''',3╟2πc'')/0'         °
  647.   'a╜a,(╞w),'':'',(2╟5πc),'':''' 'b╜(+\r=''('')-+\r='')''' 'b╜b∞0'             °
  648. X 'a╜a,(²3╟(b-1)╞3╟r),'':'',2╟»(b+2)╟r' 'a,(3<µ2πc)/''  Σ'',3╟2πc'             °
  649. *(1997 7 13 12 28 57 536)                                                      °
  650.  Fshowfn ÉFX 'U╜V showfn W;F;N;T;ÉIO' 'Σ Simulate ╖W[É]'                       °
  651.   'T╜(0=ÉNC ''V'')doif ''V╜0''' 'ÉIO╜0'                                        °
  652.   'U╜r,''      '',''╖'',W,''[É]'',(╞V)╞''╖''' 'N╜1╞µF╜ÉCR W' 'N╜«∞N'           °
  653.   'N╜(N⌠'' '')ΓN' 'F╜(π''['',■N,■Γ''] ''),F'                                   °
  654.   'T╜(1<µ,V)doif ''F╜F[1╟V;]'' ''U╜''''''''''' 'U╜²1╟U,r,,F,r'                 °
  655. X 'U╜((-+/^\'' ''=ΦU)╟U),('' ╖'')[╞V],r'                                       °
  656. *(1997 7 13 12 28 58 540)                                                      °
  657.  Fsimdd ÉFX 'u╜simdd w;e' 'Σ Direct definition mode' 'u╜0'                     °
  658.   '╕((0⌠ÉNC╞w)doif ''''''Already defined'''''')/0' 'e╜''α''ε2πw'               °
  659.   'w[2]╜Γ''u╜'',''α∙ aw'' replace 2πw' 'w╜w[1 3 2]'                            °
  660. X 'w[1]╜Γε''u╜'',(e/''a ''),w[1],'' w''' 'u╜╧ÉFX w'                            °
  661. *(1992 6 3 9 59 17 424)                                                        °
  662.  Ftab ÉFX 'U╜V tab W;T;A;B;C;D;E;F;G;M;ÉPW' 'Σ Tabulate list W'                °
  663.   'T╜(0=ÉNC ''V'')doif ''V╜0''' 'M╜''Invalid data for tabulation'''            °
  664.   'V╜4╞V' 'ÉPW╜130╛30⌐G╜V[2]+79⌡V[2]=0'                                        °
  665.   'L1:╕((1<╧W)doif ''''''W╜∞0'''' ÉEA ''''W╜πW'''''')/L1'                      °
  666.   '╕(((0=µεW)δ2<µµW)doif ''U╜(~V╧4╞0)/M'')/0'                                  °
  667.   'T╜(1≥µµU╜«W)doif ''U╜πW╜(U⌠'''' '''')ΓU'''                                  °
  668.   'T╜(0<V[1])doif ''U╜(«(Φ1,╞µW)µ(V[3]µ'''' ''''),∞(╞µW)-V[3]),'''' ''''       °
  669.  ,U''' '╕(G<30)/0' 'T╜(F╜µεV[4])+C╜1╟B╜µA╜(V[3],0)╟U'                          °
  670.   'T╜⌐(1╞B)÷1⌐╛(ÉPW+F)÷T' 'U╜(E╜(V[3],C)╞U),[1](B╜T,1╟B)╞A'                    °
  671.   '''D╜εV[4]'' ÉEA ''D╜ÉAV[εV[4]+33⌡V[4]=0]''' 'L0:A╜(T,0)╟A'                  °
  672. X '╕(0=1╞µA)/0' 'U╜U,(((T+V[3]),µD)µD),E,[1]B╞A' '╕L0'                         °
  673. *(1997 7 13 12 28 59 544)                                                      °
  674.  Ftest ÉFX 'U╜V test W;P'                                                      °
  675.   'Σ Describe problem in W, (correct answer in V)' 'U╜2' 'L1:W'                °
  676.   'É╜''      ''' 'P╜æ' '''╕L0'' ÉEA ''P╜»P''' '╕(V╧P)/0'                       °
  677. X 'L0:╕(0=U╜U-1)/0' '''Incorrect. Try again''' '╕L1'                           °
  678. XCuc 1 26 ABCDEFGHIJKLMNOPQRSTUVWXYZ                                           °
  679. *(1996 4 6 16 9 6 228)                                                         °
  680.  Fvec ÉFX 'U╜vec' 'Σ Draw 2d vector in plane'                                  °
  681.   'U╜r,r,''2-        +'',r '':      °'',r,''1-    °'',r'                       °
  682. X 'U╜U,'' :  °'',r,''0|....|....|'',r,'' 0    1    2'',r'                      °
  683.