210 likes | 364 Views
Utilities in Dyalog APL. Dan Baronet Boston 2011 V1.00. []SE vs #. There are 2 “work spaces ” available at all times when using Dyalog: []SE which holds session (static) data And # which is the workspace as such (dynamic). Memory layout. []SE. #. . dws file. . dse file.
E N D
Utilities in Dyalog APL Dan Baronet Boston 2011 V1.00 Dyalog’11 - Boston
[]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) Dyalog’11 - Boston
Memory layout []SE # .dws file .dse file Dyalog’11 - Boston
[]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. Dyalog’11 - Boston
# # 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. Dyalog’11 - Boston
[]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. Dyalog’11 - Boston
[]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: Dyalog’11 - Boston
[]SE – loading and saving If you wish to use a different name for the session file you can use Save as… Dyalog’11 - Boston
[]SE – loading and saving If you want APL to use it automatically you will then need to tell APL which session (.DSE) file to load at start-up: Dyalog’11 - Boston
[]SE : using it as storage It may be convenient enough to store utilities in []SE and use them from there. You can even add some GUI to use them. Dyalog’11 - Boston
[]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 Dyalog’11 - Boston
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. Dyalog’11 - Boston
SALT 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 Dyalog’11 - Boston
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 Dyalog’11 - Boston
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’ Dyalog’11 - Boston
Keyboard Shortcuts Ctrl-Shift-End : highlight to the end of text Ctrl-delete : remove highlighted text Ctrl-Home/End : go to the beginning/end of the text Shift-Esc : cancel operation Space (in session): mark current line for re-execution (several can be marked) Keypad - : toggle line numbers Keypad / : reformat according to configuration Ctrl-Up : localize name Ctrl-Shift-BS/Enter: undo/redo Dyalog’11 - Boston
Examples • The <calendar> function. • The <time> user command • The Dyalog utilities Dyalog’11 - Boston
The APL Wiki Dyalog’11 - Boston