💾 Archived View for blitter.com › apl-books › apl.maxhost.org › apl-soliton.txt captured on 2024-05-12 at 16:35:19.

View Raw

More Information

⬅️ Previous capture (2022-07-16)

-=-=-=-=-=-=-

This document describes soliton APL and uses UTF-8 encoding

when editing this document first set:
export LC_ALL=utf-8
then
kedit apl-soliton.txt
or use bash script soliton-notes.sh

use KAPL fonts in kedit with utf-8 encoding

sax.sh   run soliton APL

)sesm trans keyw #

transliterations must be proceeded by a # character
note that apl-8 must be used for transliterations
e.g. v #is 1 2 3 4 5

Ìavm     displays current mapping in use
Ìpp      print precision
Ìps      controls position and spacing (default is ¢1 ¢1 0 1)
Ìps û 0 0 ¢2 ¢2
         boxes enclosed arrays
Ìpw      printing width 
Ìruns    report running tasks
ÌSYSVER  reports system version
ÌUSERID  report user id

)        recall previous line of apl
)edit test
         edit function test
)save test
         save function test
)help    display system commands
)clear   erase workspace
)keys    display key mappings
)fns     list all functions in workspace
)libs    display library numbers and directory paths
)load /home/cubeman/test.ws
         load a workspace
)load 1 toolkit
         load sharp toolkit
           arabic 'xxiv'   returns base 10 equivalent
           roman 23        returns roman numeral equivalent
           easter 1997     returns date of easter for 1997
           3 hfd 100       return hex equivalent from decimal numbers to 3 digits
                           e.g. 064
           frame array
           date   displays date
           moonphase mm dd yyy
           triangle 8      print a triangle
           time            display time
           vi '45 apple twinkie 0'
                           returns valid numeric input, e.g. 1 0 0 1
)load 1 aplascii
)load 1 pc108
)load 1 if
)load 1 socket
)load 1 unix
)load 1 wstransfer
)off      terminate apl session
)save test1
          save current workspace as test1.sw in home directory

'sapl.version' Ìbind 'ver'
Ìps û -1 1 3 3
ver ''     
           returns version information box

diamond operator acts like a separator, e.g
v û 1 þ w û 1

vû1 2 3 4 5
v¨1Ùv     find elements which differ from first element
          returns 0 1 1 1 1

'abc def' û 1 2
          assign 1 to abc and assign 2 to def

x û 31 41 59 26 53 58 97 93
0{x       returns 31
7{x       returns 93

x û < 1 2 3
          creates enclosed array

x û (< 1 2 3), (< 4 5 6)
x[1]      returns 1 2 3
x[2]      returns 4 5 6
+/>x      returns 6 15
0@x       returns 1 2 3
1@x       returns 4 5 6
(>x[1]) + (>x[2])
          returns 5 7 9

a û 1 2 3
b û 4 5 6
c û 7 8 9
x û ØaØbØc
          x is assigned the enclosed values of a b and c
Òx        returns 3 

x û 1, 's'
          creates heterogeneous array

x û 3 3 Ò É9
ÒÒx       returns 2

ÒÒ x û < 'now is the time'
          returns 0

77 ^ 11   returns 77 or the least common multiple
77 © 11   returns 11 or the greatest common divisor

2/-4 5    returns ¢4 ¢4 ¢5 ¢5

x û 5 7 9
b û 1 2 3 , ¡>x
          returns 1 5 2 7 3 9
>b        returns 1 5
                  2 7
                  3 9

newline û 10@Ìav

z û (É paw 0 ) 1 2 3
          returns 1 0 0
                  1 2 0
                  1 2 3

Çprime1[Ì]Ç  display function prime1 (this is the same for apl\360)

⌹2      the reciprocal is returned if
        the right argument to matrix inverse is a number

keys
----

remember to use )keys to display key mappings

alt '         Ý left
alt ;         Û right
alt [         û assign
alt shift c   ã comment
alt shift e   å find
alt shift f   ½ depth
alt shift y   ´ yen
alt shift j     paw
alt shift .     delta with underline
alt shift +   ⌹ quad-divide or domino
alt i           iota
alt r         Ò shape
alt g         Ç del
alt h         È delta
alt x         Ø conditional enclose
alt 1         ¡ under or with
alt 9         © or 
alt 0         
left alt m      magnitude

left shift [    {
left shift ]    }

< enclose
> disclose

full screen editor
------------------

)edit test
          edit function test
tab q     exit editor
tab z     write 

Note that using Ç isn't necessary when using the full screen editor

toolkit features
----------------

once the toolkit is loaded via ')load 1 toolkit'
many variables are set to display tutorials such as:

howhfd         hex equivalent of integers <d> to <n> hex positions
howmatrix      explains function matrix
howmoonphase   compute phase of moon <r> for dates <d> = (mm dd yyyy style)

)lib functions
--------------

prime1
pascal
               
observations
------------

run rc_local.sax as root if necessary
this activates the Network Shared Variable Processor (NSVP)
should say 'SVP initialization complete' 

operators have higher precedence than functions

soliton APL uses xterm so the user must check things like
.Xdefaults to ensure that font settings are not over-ridden

switching from openapl to soliton apl is problematic,
it is necessary to xmodmap usapl.txt to set keyboard correctly

an array that contains enclosed elements is called a nested array

variable names can start with È

a singleton is an array containing exactly one element