Limbering Up: Comparing Functions
Vector 20:2, page 33
Transcribed from the printed issue; not yet reviewed. Read it in the PDF of the issue, page 33
Limbering Up: Comparing Functions¶
(The purpose of this column is to work some flab off you APL midsection. Like muscles, your APL skills can atrophy if not exercised with adequate frequency and variety. This column presents a task for you to perform. Set aside a few minutes from your busy schedule and work the task. Mail in your solution and stay tuned for the results.)
The symbols for format (⍕) and execute (⍎) were chosen carefully by the implementers of APL to imply an inverse relationship. After all, ⍕ turns the numbers 3 4 5 into the character vector '3 4 5'. However, ⍕ and ⍎ are not perfect inverses. For example, ⍕ converts a numeric matrix into a character matrix, but ⍎ does not do the reverse.
Your task is to write a monadic function EI (Execute Inverse) that converts any array A to a character vector such that A≡⍎EI A. There are a number of useful applications for a function that translates an APL array into a character vector. We’ll discuss them next issue.
Send your solution to:
Vector Production
Brook House
Gilling East
York YO62 4JJ
UK email apl385@compuserve.com
The notable functions and their authors’ names will be printed in the next issue of Vector. Good luck and happy limbering.
Reprinted with kind permission from Zark APL Tutor News, a quarterly publication of Zark Incorporated, 23 Ketchbrook Lane, Ellington, CT06029, USA