4 ms·
>Why is everyone raving about the incomprehensible syntax? I admit that this is the first time I see APL code. You've answered your own question. It's only "i
by coldtea 8y ago
>Why is everyone raving about the incomprehensible syntax? I admit that this is the first time I see APL code.
You've answered your own question.
It's only "incomprehensible" if you're not familiar with it.
After you've studied it it is very powerful and very succinct.
The article even gives an example:
Just consider the extract !'\:/:. The !
operator means rotation in this context.
If used as n!v it rotates the vector v by
n. But we do not directly use the
operator like that, we modify it using
the adverb ', which generally denotes a f
unctional map. Now we can do something
like n!'m to rotate each row vector in
the matrix m, that is each element of the
vector of vectors m, by n, or more
generally we can say something like v!'m
to rotate each row m[i] in the matrix m
by the corresponding element of v[i].
A good analogy I would give is the equally "cryptic" to the uninitiated, but equally fast and powerful, to those that mastered them, vi(m) text manipulation commands -- which also use a very similar concept of modifiers and targets and so on.
- sethrin 8y agoThe following video is probably reasonably well known, and I wish that I had a more intelligent commentary than to say that it blows my mind, but it does I think bear out the point of expressivity rather well. https://youtu.be/a9xAKttWgP4 https://youtu.be/a9xAKttWgP4 Conway's Game of Life in some 50 characters of APL.