utilities in dyalog apl dan baronet boston 2011 v1.00 0dyalog’11 - bostonutilities

21
Utilities in Dyalog APL Dan Baronet Boston 2011 V1.00 1 Dyalog’11 - Boston Utilities

Upload: bernice-brown

Post on 04-Jan-2016

217 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Utilities in Dyalog APL Dan Baronet Boston 2011 V1.00 0Dyalog’11 - BostonUtilities

Utilities in Dyalog APL

Dan BaronetBoston 2011

V1.00

1Dyalog’11 - BostonUtilities

Page 2: Utilities in Dyalog APL Dan Baronet Boston 2011 V1.00 0Dyalog’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

Page 3: Utilities in Dyalog APL Dan Baronet Boston 2011 V1.00 0Dyalog’11 - BostonUtilities

Memory layout

Utilities Dyalog’11 - Boston 3

[]SE

.dsefile

.dwsfile

#

Page 4: Utilities in Dyalog APL Dan Baronet Boston 2011 V1.00 0Dyalog’11 - BostonUtilities

[]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

Page 5: Utilities in Dyalog APL Dan Baronet Boston 2011 V1.00 0Dyalog’11 - BostonUtilities

#

# 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

Page 6: Utilities in Dyalog APL Dan Baronet Boston 2011 V1.00 0Dyalog’11 - BostonUtilities

[]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

Page 7: Utilities in Dyalog APL Dan Baronet Boston 2011 V1.00 0Dyalog’11 - BostonUtilities

[]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

Page 8: Utilities in Dyalog APL Dan Baronet Boston 2011 V1.00 0Dyalog’11 - BostonUtilities

[]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

Page 9: Utilities in Dyalog APL Dan Baronet Boston 2011 V1.00 0Dyalog’11 - BostonUtilities

[]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

Page 10: Utilities in Dyalog APL Dan Baronet Boston 2011 V1.00 0Dyalog’11 - BostonUtilities

[]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

Page 11: Utilities in Dyalog APL Dan Baronet Boston 2011 V1.00 0Dyalog’11 - BostonUtilities

[]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

Page 12: Utilities in Dyalog APL Dan Baronet Boston 2011 V1.00 0Dyalog’11 - BostonUtilities

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

Page 13: Utilities in Dyalog APL Dan Baronet Boston 2011 V1.00 0Dyalog’11 - BostonUtilities

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

Page 14: Utilities in Dyalog APL Dan Baronet Boston 2011 V1.00 0Dyalog’11 - BostonUtilities

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

Page 15: Utilities in Dyalog APL Dan Baronet Boston 2011 V1.00 0Dyalog’11 - BostonUtilities

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

Page 16: Utilities in Dyalog APL Dan Baronet Boston 2011 V1.00 0Dyalog’11 - BostonUtilities

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

Page 17: Utilities in Dyalog APL Dan Baronet Boston 2011 V1.00 0Dyalog’11 - BostonUtilities

Examples

- The <calendar> function.- The <time> user command- The Dyalog utilities

Utilities Dyalog’11 - Boston 17

Page 18: Utilities in Dyalog APL Dan Baronet Boston 2011 V1.00 0Dyalog’11 - BostonUtilities

The APL Wiki

Utilities Dyalog’11 - Boston 18

Page 19: Utilities in Dyalog APL Dan Baronet Boston 2011 V1.00 0Dyalog’11 - BostonUtilities

Utilities Dyalog’11 - Boston 19

Page 20: Utilities in Dyalog APL Dan Baronet Boston 2011 V1.00 0Dyalog’11 - BostonUtilities

Utilities Dyalog’11 - Boston 20

Page 21: Utilities in Dyalog APL Dan Baronet Boston 2011 V1.00 0Dyalog’11 - BostonUtilities

Utilities Dyalog’11 - Boston 21