utilities in dyalog apl dan baronet boston 2011 v1.00 0dyalog’11 - bostonutilities
TRANSCRIPT
Utilities in Dyalog APL
Dan BaronetBoston 2011
V1.00
1Dyalog’11 - BostonUtilities
[]SE vs #
There are 2 “workspaces” available at all times when using Dyalog:
[]SE which holds session (static) data
And# which is the workspace as such
(dynamic)
2Dyalog’11 - BostonUtilities
Memory layout
Utilities Dyalog’11 - Boston 3
[]SE
.dsefile
.dwsfile
#
[]SE
Previously []SE was only used in GUI versions to hold session objects (menus, toolbars, statusbars, …)
It is now used to also contain utilities like SALT.
Utilities Dyalog’11 - Boston 4
#
# is dynamic, this is where you )LOAD workspaces and )SAVE them from.
You can write utilities, store them in a .DWS file and )COPY them when needed.
That’s one way to do it and it’s been done for ages.
Utilities Dyalog’11 - Boston 5
[]SE
[]SE is static. You can store utilities there and refer
to them either using their full path (e.g. []SE.myUtil) or by setting []PATH to ‘[]SE’.
No other APL offers this.For many this is new.
Utilities Dyalog’11 - Boston 6
[]SE – loading and saving[]SE is loaded at start-up time.If you modify it it can be saved using the
Session/Save menu item:
Utilities Dyalog’11 - Boston 7
[]SE – loading and savingIf you wish to use a different name for
the session file you can use Save as…
Utilities Dyalog’11 - Boston 8
[]SE – loading and savingIf you want APL to use it automatically you
will then need to tell APL which session (.DSE) file to load at start-up:
Utilities Dyalog’11 - Boston 9
[]SE : using it as storageIt may be convenient enough to store
utilities in []SE and use them from there.You can even add some GUI to use them.
Utilities Dyalog’11 - Boston 10
[]SE – storing utilities
Dyalog stores utilities in []SE.They are in namespaces - General line Parser- SALT & Spice (UCMD framework)- Dyalog utilities- Chart- The User Command function Utilities Dyalog’11 - Boston 11
SALT
SALT is basically a pair of functions to read and write APL code outside the workspace
One feature of SALT is to hook into the editor to save objects automatically.
SALT has more functionality and can be used as a version control system.
Utilities Dyalog’11 - Boston 12
SALT uses Unicode text files as storage medium.
Text files can be shared and integrate well with other VCS
SALT is the base for Spice
Utilities Dyalog’11 - Boston 13
SALT
Spice
Spice is the interface between you and your code stored in SALT files.
It allows you to execute your code under your own rules.
Spice is the framework of User Commands
Utilities Dyalog’11 - Boston 14
User Commands
UCMDS are SALT based functions called thru the ] syntax.
All the basic code resides in a SALTed text file with specific format.
When “]CAL 12” is entered in the session its main <Run> function is called with arguments ‘CAL’ ‘12’
Utilities Dyalog’11 - Boston 15
Keyboard ShortcutsCtrl-Shift-End : highlight to the end of textCtrl-delete : remove highlighted textCtrl-Home/End : go to the beginning/end of the textShift-Esc : cancel operationSpace (in session): mark current line for re-execution
(several can be marked)Keypad - : toggle line numbersKeypad / : reformat according to configurationCtrl-Up : localize nameCtrl-Shift-BS/Enter: undo/redo
Utilities Dyalog’11 - Boston 16
Examples
- The <calendar> function.- The <time> user command- The Dyalog utilities
Utilities Dyalog’11 - Boston 17
The APL Wiki
Utilities Dyalog’11 - Boston 18
Utilities Dyalog’11 - Boston 19
Utilities Dyalog’11 - Boston 20
Utilities Dyalog’11 - Boston 21