6. A Pointless Language
• Entirely dynamic, highly abstract
• Largely interpreted (line by line execution)
• “Keywords” are symbols
• Tacit programming
• Short programs, probably about 1 line
• Write-only language
7. How the magic happens
• Right to left evaluation, except for parens
5 + 5
10
5 x 5
25
5 × 5 + 5
50
(5 × 5) + 5
30
8. Time to get crazy
• Types of data are largely done for you
1 2 3 + 5
6 7 8
¼9
1 2 3 4 5 6 7 8 9
2 4 ½¼9
1 2 3 4 5 6 7
8 9 1 2 3 4 5
10. Boring APL stuff
• Specifications
– ISO (International Standards Organization
– APL2, by IBM
• Interpreted
– Thus, Interpreters
• APL+
• APLX
• Dyalog APL
• VisualAPL
11. Interpreters
• Use workspaces, and have unique specs
– Workspace
– System Variables
– System Functions
• Modes
– Calculator mode
– Definition mode
12. Simple Data
• A number
– 24595
– Can be decimal or negative
• A character
– ‘s’
– Wrapped in single quotes
– ‘Use two ‘’ to escape the ‘’ ‘
13. Data Structures
• May have data, has dimensions
• Data does not have dimensions
• Struct – 1 item, no dimensions
• Vector- 1d list of items
• Matrix -2D..nD list of items
• Item can be character, number or structure
• Data structures can have mixed data, or nested
14. Data and structure syntax
• To store a variable
[name] „ [variable]
• Names can start with a letter and NOTHING
else
• Names can have numbers and some symbols
• Don’t duplicate names
15. Functions
• Types
– 0 arguments (niladic)
– 1 argument (monadic)
• Everything to the right
– 2 arguments (dyadic)
• Everything to the right
• First item to the left
• Can return data/data structure
• Bucket brigade
• Can be named like data
• One symbol, 1-2 functions, depending on arguments
16. Operations
• Modify the function of…functions.
– How functions are applied to data
• In addition to 0-2 arguments, can take 1-2
operands
• Functions can be operands
• Can also be named like functions
17. Classes
• Logical grouping of data and functions
„ŒNEW CLASSNAME
[classname].[function/property]
• Can have constructors.
• Some interpreters let you use external classes
– .NET
21. System Variables and Functions
• Variables
– Easy to pick out, they start with Œ
– Change depending on interpreter
• Functions
– Start with a )
– Also change depending on interpreter
22. Can’t cover everything!
• Can you have threads?
– Yes. Some interpreters.
• Can you have labels?
– In function and operation definitions.
– This includes if/else and try/catch blocks
• Where can I learn more?
– Classes quoted at ~$2000 per day per person
23. The future is J
• APL transformed to be easier to read
quicksort=: (($:@(<#[), (=#[), $:@(>#[)) ({~ ?@#))
^: (1<#)
25. Questions for YOU
1. ⍳9 Returns what?
1 2 3 4 5 6 7 8 9
2. What does an operator in APL do?
Changes how a function is applied to data
3. To create a 3 dimensional array:
(1 2 3) ⍴ (5 4)
26. Questions for me?
There are three things a man must do
before his life is done
write two lines in APL,
and make the damn thing run
Editor's Notes
He didn't like the standard mathematical notation so he created his ownOriginally named IBM (Iverson’s Better Math), but that didn't fly with IBMwhich describe interpersonal communication, not a programming languageName was changed to APL, a programming language, named after a chapter in his book