APL Trivia – Funny Dates
Vector 3:3, page 115
Transcribed from the printed issue; not yet reviewed. Read it in the PDF of the issue, page 115
First, thanks are due to John Searle from Sydney, Australia, who was originally responsible for the ‘Meaning of life, the universe and everything’ expression, which evaluates to 42. What will John’s next numerological submission be?
But now to the dates. The following expressions were executed under APL2 release 2, running in a TSO environment:
NAMES←¯11 3↑∆TSO'APL PDSI ''VSS.NAMES.AP2TN011'''
⎕←NAMES←⊂[2]NAMES
ATR CAN CTK CTN DAN FED KTC PFA RTA SAN SVI
(⊂3 11) ⎕NA¨NAMES
1 1 1 1 1 1 1 1 1 1 1
⊃[2] 2 ⎕AT¨NAMES
1985 4 1 12 0 0 0
1985 4 1 12 0 0 0
1985 4 1 12 0 0 0
1985 4 1 12 0 0 0
1985 4 1 12 0 0 0
1985 4 1 12 0 0 0
1985 4 1 12 0 0 0
1985 4 1 12 0 0 0
1985 4 1 12 0 0 0
1985 4 1 12 0 0 0
1985 4 1 12 0 0 0
The ⎕AT system function can be used with a left argument of 2 to discover the date and time that any defined function was saved. After defining the APL2 intrinsic functions supplied with the APL2 product, the 2-⎕AT is applied to each name. As you can see above, it turns out that they were all created exactly at the end of April fools day, 1985! Can this be mere coincidence? Thanks to David Piper for pointing out this curious behaviour.
It makes sense to try 2-⎕AT with primitive APL2 functions as well, but in this case we just get a timestamp of 7 zeroes – not so interesting. At least, in immediate execution mode we do. However, any primitive APL2 function may be an operand to an APL2 user-defined operator, so it’s possible to apply ⎕AT to this operand within the definition of the operator:
∇QUAD_AT[⎕]∇
∇
[0] RE←(LO QUAD_AT)RA
[1] RE←RA ⎕AT 'LO'
∇
2 ⎕AT '⍟'
0 0 0 0 0 0 0
⍟ QUAD_AT 2
1614 2 7 18 28 18 285
The result when the operator is applied to the log primitive appears to be the birth date of Napier, the Scottish mathematician who discovered logarithms! The question is, is the time accurate? Before you rush to try this with other primitive functions, it only seems to produce a non-zero timestamp for the logarithm function. Further developments awaited eagerly.