DYNA25: Spring Edition is taking place on 7 April in New York City. More info

The author

Genius, Gentleman and Mischievous Schoolboy

About

John Morley Scholes (1948–2019) was a British computer scientist. His professional career was devoted to the development of APL. He was the first lead developer at what eventually became Dyalog Ltd. and kept working for the company until his death, since when he has dedicated himself to the art of writing perfect programs. More about John

Share this page

For-loops Given an initial state defined by a number of variables, a for-loop iterates through its argument array modifying the state.     A←... ⋄ B←... ⋄ C←...       ⍝ initial state     :For item :In items         ⍝ iterating through array "items"         A←A ... item            ⍝ new value for A depending on item         C←C ... A ... item      ⍝ new value for C depending on A and item         ...                     ⍝ state updated     :EndFor     A B C                       ⍝ … Read
I’ve taken to commenting the closing brace of my inner dfns with a home-grown type notation pinched from the Functional Programming community: dref←{ ⍝ Value for name ⍵ in dictionary ⍺ names values←⍺ ⍝ dictionary pair (names⍳⊂⍵)⊃values ⍝ value corresponding to name ⍵ } ⍝ :: Value ← Dict ∇ Name I keep changing my … Read
APL is sometimes criticised because expressions that include names cannot, in general, be parsed without knowing whether the names represent functions or variables. For example, the name thing in the expression thing⍳3 could reference an array (in which case the ⍳ is dyadic) or it could reference a function (making the ⍳ monadic). An APL … Read
“We do not realize what tremendous power the structure of an habitual language has. It is not an exaggeration to say that it enslaves us through the mechanism of s[emantic] r[eactions] and that the structure which a language exhibits, and impresses upon us unconsciously, is automatically projected upon the world around us.” —Korzybski (1930) in … Read
In one man’s humble opinion, reduction (⌿) is the Queen of Operators. Each (¨) comes a close second, but doesn’t get the cigar because each can be written in terms of reduction. Two special cases are of interest: reduction along axes of length 1 (or reduction of a scalar) and reduction along axes of length … Read
Operator trace from dfns.dws is a simple and low-tech tool for displaying intermediate results of functions, during the evaluation of an expression. For example, what’s going on here? (+⌿ ÷ ≢) 1 2 3 4 2.5 We can guess that the above fork is computing the average of the right argument. To see how this works: )copy dfns … Read
ACKNOWLEDGEMENT: My thanks to Andy Shiers for simplifying the examples Visitors to APL from other languages are sometimes a bit sniffy about our use of numbers (1 0) for Boolean values True and False. They’re further bemused by our fondness for moving conditional processing out of code and into data. For example, instead of: 0=2|⍵: … Read

By other authors

Get Support

Technical advice and assistance on all aspects of Dyalog usage is available by e-mail (support@dyalog.com) and/or telephone (+44 1256 830030 – limited to U.K. office hours). Limited advice on design and coding is available, but is not intended to replace the use of the printed and on-line documentation. Except when reporting an issue with the software, users are encouraged to seek advice from the user community via the Dyalog Forum (reading the content of the forums does not require membership).

Search our website...