Learning APL with APLX APLX
Total Page:16
File Type:pdf, Size:1020Kb
APLX Learning APL with APLX Version 5.0 Learning APL with APLX 2 Copyright © 1985-2009 MicroAPL Ltd. All rights reserved worldwide. APLX, APL.68000 and MicroAPL are trademarks of MicroAPL Ltd. All other trademarks acknowledged. APLX is a proprietary product of MicroAPL Ltd, and its use is subject to the license agreement in force. Unauthorized copying or use of APLX is illegal. MicroAPL Ltd makes no warranties in respect of the suitability of APLX for any particular purpose, and accepts no liability for any loss arising out of the use of APLX or arising from the information contained in this manual. MicroAPL welcomes your comments and suggestions. Please visit our website: http://www.microapl.co.uk/apl Version 5.0 July 2009 Learning APL with APLX 3 Contents Contents .............................................................................................................................................................. 3 Introduction to APL ....................................................................................................................................... 11 Origins of APL ............................................................................................................................................ 11 Some features of the language .................................................................................................................. 11 Entering APL Symbols ................................................................................................................................... 15 The QuickSymTM pop-up ............................................................................................................................ 15 Using an extended keyboard layout ........................................................................................................... 15 Choosing and customizing the keyboard layout ......................................................................................... 16 Customizing the keyboard layout ............................................................................................................... 16 The QuickSym pop-up ................................................................................................................................... 17 Bringing up the QuickSym window ............................................................................................................ 17 Using the keyboard with the QuickSym window ........................................................................................ 17 The contextual menu ................................................................................................................................. 18 Simple Arithmetic ......................................................................................................................................... 21 The initial APLX display .............................................................................................................................. 21 Some arithmetic functions ......................................................................................................................... 21 Error Messages .......................................................................................................................................... 22 Using the Session Window ......................................................................................................................... 23 Arithmetic on lists of numbers ................................................................................................................... 24 Matching up list lengths ............................................................................................................................. 24 Order of execution ..................................................................................................................................... 25 Parentheses ............................................................................................................................................... 26 Negative numbers and subtract ................................................................................................................. 26 Dual-purpose functions ............................................................................................................................. 26 Ceiling and Floor (⊧ and ⌊) ........................................................................................................................ 28 Summary ................................................................................................................................................... 30 Learning APL with APLX 4 Practice ...................................................................................................................................................... 30 Problems ................................................................................................................................................... 30 Answers ..................................................................................................................................................... 31 Variables ....................................................................................................................................................... 33 Assignments .............................................................................................................................................. 33 Variable names .......................................................................................................................................... 34 Assigning lists to variables ......................................................................................................................... 35 System Commands .................................................................................................................................... 35 Character assignments............................................................................................................................... 37 Multiple assignments ................................................................................................................................. 38 Displaying variables together ..................................................................................................................... 39 Joining lists together .................................................................................................................................. 39 Joining and merging variables .................................................................................................................... 40 Simple and nested variables ...................................................................................................................... 41 Mixed variables.......................................................................................................................................... 41 Summary ................................................................................................................................................... 41 Practice ...................................................................................................................................................... 42 Problems ................................................................................................................................................... 42 Tables ............................................................................................................................................................ 45 The ? function ........................................................................................................................................... 45 The ⍯ function ........................................................................................................................................... 46 Setting up tables ........................................................................................................................................ 46 Arithmetic on tables .................................................................................................................................. 48 Catenating tables ....................................................................................................................................... 50 Selecting elements ..................................................................................................................................... 51 Dimensions ................................................................................................................................................ 53 Enquiring about the size of data ................................................................................................................ 54 Tables of characters ................................................................................................................................... 55 Learning APL with APLX 5 Mixed tables .............................................................................................................................................. 57 Nested tables ............................................................................................................................................. 58 Depth ........................................................................................................................................................