💾 Archived View for blitter.com › apl-books › apl.maxhost.org › apl-11-1976-1977.txt captured on 2024-05-12 at 16:35:13.
⬅️ Previous capture (2022-07-16)
-=-=-=-=-=-=-
apl\11 1977 runs under Unix version 6 and 7 note that in most versions of apl that the shape of a vector of one element is null and this can not be used in mathematical expressions feb 1977 version ---------------- precompiled binary is used, we are not able to compile it as yet separate executable works (unlike oct 1976 version which core dumps on edit) labels are supported comments inside functions must occur after function definition (first line) no blank lines in functions stty erase ^H do not use avoid hitting backspace use M instead of X for multiply use P instead of % for divide L^HP a returns matrix inverse of a (ctrl-H is not echoed to screen) )clear clears workspace )width 80 set characters per line to 80 )vars list all variables )fns list all functions )edit test edit function test (this also puts function test in memory) note that for this version )edit invokes xed )erase file erase function file from workspace )drop file erase file E 'v { 1 2 3' execute string, e.g. v is set to 1 2 3 epilson will not work as execute on IBM APL2 1 V 0 1 or 0 returns 1 1 /^H= 2 1 not equal 2 returns 1 x { 2 'x = '; x displays x= 2 a { 2; b { 3; c { 4 multiple statements on one line are separated by semi-colons 'this is a ';a;' and b '; b displays this is a 2 and b 3 a { 'cat' variables can be strings of characters 'APPLE'[3] returns 3rd character of APPLE, .e.g P a { 'apple' b { 'string' c { a,' ',b assign c the value of a and b with a space inbetween e.g. c is 'apple string' a { (I10) M .5 same as a=1 to 10 step .5 !3.5 returns 11.6317284 (fractional factorials are permitted) 2 ! 4 choose 2 from 4, i.e. 6 (also known as binomial coefficient) B^HN 20 example of an ibeam, generally B ctrl-H N followed by a number in this case it returns the total number of 1/60 sec intervals since midnight B^HN 21 ??? B^HN 24 ??? B^HN 25 ??? B^HN 28 returns date B^HN 29 returns origin B^HN 30 returns width x { L enter numeric data (L is quad) 'test'; x { L prompts must appear on the same line as quad to work functions --------- average v find average of a vector boxit 'test' display a box around test factors v find all factors of vector fib n generate n terms fibonacci series (modified to work with apl-1977) gcd find the greatest common divisor, e.g. 70 gcd 10 ident generate the identity matrix inverse a find matrix inverse of a where a is a matrix matrix a display a matrix a X a of counting numbers multi a generate multiplication table of a X a (will core dump if array is too big) matrixab a b generates matrix of counting numbers a by b prime works but core dumps if values higher than 70 are used primen n display prime numbers up to n rising compute the rising factorial primei does not work, returns "compress index" fib1 does not work, returns "fetch botch" doesn't have ------------ Lrun Lcr )shell )list xed notes --------- XED V2.71 pp print out entire file f display current filename x undelete last deletion oct 1976 version ---------------- must be compiled as a pure executable to work properly labels are not supported, line numbers must be used instead }clear clear workspace } represents right parentheses }drop file erase file }edit test edit function test (this also puts function test in memory) note that for this version }edit invokes ed }erase a erase variable or function a }fns list functions }lib list files in current directory }read matrixab read in function matrixab }vars list variables }width 112 set width to 112 }off log out C for comment R for rho E for epsilon D for min (floor) S for max (ceiling) Y for take (up arrow) U for drop (down arrow) M for absolute value or modulus Q for deal ; is [ ] is ]