Upload
charlotte-simon
View
255
Download
8
Embed Size (px)
Citation preview
APL in Second Gear
Does APL have a future?
What’s the point of APL?
Did Ken Iverson invent APL?
Did Ken Iverson discover APL?
APL Exists in the Mind of the Beholder
APL is a Tool of Thought
But of whose thoughts?
APL Big Bang Theory
What’s the point of APL?
A notation of direct abstraction is possible
Skip the fluff
Trim the fat
Keep it simple Cut the crap
1-to-1 (notion to notation)
Don’t waste my time
The APL Food Chain
The Consumer
The Business
The Industry Software Expert
The APLer
The Utility Wizard
The APL Interpreter Developer
The Operating System Developer
The Consumer
The Business
The Industry Software Expert
The APLer
The Utility Wizard
The APL Interpreter Developer
The Operating System Developer
The Invisible Utility Wizard
I don’t buy it.We don’t have a Utility Wizard and we don’t
needone. We do just fine.
We already know how to compute an average. We
don’t need another method.
Our method works just fine.
(Prepare to fall in love again.)
A notation of direct abstraction is possible
or
Trim the fat
First gear: Primitives
And so on.
Second gear: Utilities built on primitives
Third gear: Utilities built on utilities
Given today’s date TODAY (yyyymmdd)
and a birthdate DOB (yyyymmdd), what
is the age of the policyholder?
„„
„
Given today’s date TODAY (yyyymmdd)
and the contract date POLDAT (yyyymmdd), how many days has
the policy been in effect?
„
Given today’s date TODAY (yyyymmdd), what will be the date (yyyymmdd) in 90 days,
180 days, 360 days?
„
Format these dates as a 10-column matrix in
mm/dd/yyyy notation.
„
Compute the average ofa set of numbers V.
„
‘‘
1. Communications2. User Input3. Calculations4. File Handling5. Reports/output6. Miscellaneous
File Handling: Given a comma-delimited file that looks like the following, read its fields (except SS No.) into a set of APL variables:
Policy No.,Date of Birth,Sex,SSNo,LastName,Premiums
12614,03/15/1940,M,022-14-1567,Smith,103500
12983,05/30/1937,F,038-15-1129,Jones,58200
„„„„„„„„…„„†
File Handling: Given a fixed-format file with the following layout, read its fields
(except SS No.) into a set of APL variables:
Bytes Length Description
----- ------ -------------
1-8 8 Policy number
9-18 10 Date of birth
19 1 Sex (M or F)
20-30 11 Social Security No.
31-50 20 Last name
51-65 15 Premiums ($)
„„„„„„„„…„„†
File Handling: Save theseAPL variables in an APL file.
…
Calculations: Sum premiums and the
number of policies by year of birth.
„„„›
Reports/output: Generate thisreport, and display it on the screen:
Policy Summary Report
As of 09/22/2009
Number Total
Year of Policies Premium $
---- ----------- ---------
1940 17 12,345
1945 302 3,125,889
1946 45 55,013
„ƒ†Œ„„„„„Œ„„
Reports/output: build thereport as a Word file.
„…„œ„„
Reports/output: build thereport as an .xls file.
…„ƒ†Œ„„„„„„„œ„„„
Communications: Given two .xls filescreated by other functions, send
themas attachments to Fred in
Accounting.
„›œ„œ„œ„œ„œ„œ„„
User Input: Present a menuof choices, from which the
user is to pick one.
„
User Input: Present a menu ofchoices, from which the user
may pick any number of them.
„
User Input: Present a menu of choices, from which the user may pick any number of them. Selected choices are in a list on
the right; remaining choices are in a list on the left; Add/Remove buttons are located in
between.
„
User Input: Present a menu of choices,and allow the user to alter their order by highlighting choices and clicking
the Up or Down buttons.
„
User Input: Present the following input form:
„„„„„„„„„„›„›„›„›„„›„›„›„…„„„
Where have we gone wrong?What’s holding us back?
The ConsumerThe Business
The Industry Software Expert
The APLerThe Utility Wizard
The APL Interpreter Developer
The Operating System Developer
The solution: a different(gear-two) mindset.
The APL Interpreter Developer
- Coordinates Wizard communication- Plays “librarian,” not “author”- Documents/distributes both gears
The Utility Wizard
-Works with APLer- Communicates with other Wizards- Develops utilities
The APLer
- Provides feedback to Wizard- Writes APL
APL in Second Gear,The Future of APL