Useful Tips for Using Dyalog
Practical advice from APL users
This page contains tips that users have suggested would have been useful to know when they first started with APL. It should be read in conjunction with the Quick Start Guide.
To suggest a tip or tell us something that you wish you’d known when you first started, send an email to tips@dyalog.com for consideration for inclusion on this page.
Getting Help
]Help user command opens the online documentation. ]Help followed by a symbol, user command, or I-beam. opens the online documentation page for it. Editing
)ED to learn how to quickly create new items of various types. )ED "file:///path/file.ext" lets you edit plain-text files. 2⎕FIX'/path/file.ext'. Debugging and Meta Info
⎕JSON⍠'Compact'0⊢⎕DMX. 'tc'⎕CY'dfns' and then insert tc to the right of any function that you want to inspect.dasdsadsad The Language Bar
Shortcuts
Many in-built functionalities have neither menu items nor keyboard shortcuts assigned by default. To configure keyboard short-cuts, go to Options > Configure > Keyboard Shortcuts in the Microsoft Windows IDE or click the keyboard icon (⌨) in Ride.
Restore Ctrl key Functionality
If your input method does not use Ctrl as an APL shifting key (see Typing APL), you might want to set keyboard shortcuts that use Ctrl similarly to those in many text editors and word processing applications.
Shortcuts are denoted by two letter codes. In Dyalog for Microsoft Windows, the shortcuts can be retrieved using the ⎕KL system function. In the menu bar, go to Options > Configure and go to the Keyboard Shortcuts tab. From there, click on a row in the shortcuts table and type the desired keyboard shortcut to set it.
– Set SA to Ctrl+A to select all text in the session, edit and trace windows
– Set SC to Ctrl+F to search through the session log (use ]Locate or Tools > Search to search through code)
– Set FX to Ctrl+S to save changes in the editor without closing it
– Set CP to Ctrl+C to copy selected text to the clipboard
– Set CT to Ctrl+X to cut selected text to the clipboard
– Set PT to Ctrl+V to paste from the clipboard
– Ctrl+Z and Ctrl+Y can be set to BK and FD to undo and redo changes made in the editor; be aware that they are the same shortcut codes for scrolling backwards and forwards through input history and their defaults are often referenced in tutorials. Skipping over a line of code in the tracer uses the FD shortcut
If you use the Dyalog IME for Microsoft Windows, you can still use Ctrl+X, C and V for Cut, Copy and Paste. Start Dyalog, open the Options menu and select Configure. Then, in the Unicode Input tab select Dyalog APL IME from the dropdown menu and click on Configure Layout. Ensure that Use Ctrl+X, C, V for clipboard is selected and click OK.
Display Forms
- In the Microsoft Windows IDE: Session > Save.
- Within any Dyalog Session:
2⎕NQ⎕SE'FileWrite'.
]Rows on -fold=3 will let you scroll horizontally and trim large outputs so that they don’t flood your screen vertically. Boxing
Turn boxing on to make the display of nested arrays more clear:
]Box on
Was OFF
⍳2 3
┌───┬───┬───┐
│1 1│1 2│1 3│
├───┼───┼───┤
│2 1│2 2│2 3│
└───┴───┴───┘ trains modifier, you can display function trains with a tree structure:
]Box -trains=tree
Was -trains=box
+⌿÷≢
┌─┼─┐
⌿ ÷ ≢
┌─┘
+ fns modifier, nested arrays will have boxed display even if they are printed to the session from within functions:
PrintShape←{⍴⎕←⍵}
PrintShape ⍳1 3
1 1 1 2 1 3
1 3
]Box -fns=on
Was -fns=off
PrintShape ⍳1 3
┌───┬───┬───┐
│1 1│1 2│1 3│
└───┴───┴───┘
1 3 style modifier you can get a more verbose view, including hints for axes and data types:
]Box -style=max
┌→─────────────┐
│Was -style=min│
└──────────────┘
⊂'APL'
┌───────┐
│ ┌→──┐ │
│ │APL│ │
│ └───┘ │
└∊──────┘ ]Box -?? Quick Utilities
]Map displays the content and structure of your workspace. ]Open <filename> opens a file in its default application. ]Open <filename> opens a file in its default application. ]CD <dir> lets you change directory from inside an APL Session. ]<Command> -?. ⎕SE.Dyalog.Utils.repObj <myArray> to generate an expression for (almost) any given array. - In the Microsoft Windows IDE, go to Tools > Explorer.
- In Ride (the default interface on macOS, optional interface on other platforms), go to View > Show Workspace Explorer.
The best tips are often the ones that you pick up from other users.
If you’ve got a useful tip, send it to tips@dyalog.com and help us develop a library of real-world Dyalog wisdom.