3 ms·
This is very cool, and as an interesting side effect, it helped me understand exactly what's going on in the "famous" APL code. Well done!
by burlesona 6y ago
This is very cool, and as an interesting side effect, it helped me understand exactly what's going on in the "famous" APL code. Well done!
- dan-robertson 6y agoWell mostly but the explanation forgets to mention the ravel (comma/array flatten) operator in the comment section and the article doesn’t really explain the inner product bit (matrix multiplication in the rig of or and and), which I think is more confusing. In particular the 1 ω part.
- zverok 6y ago(author here) I noticed the thing about flatten an hour ago and fixed it (somehow thought +/, is "reduce 2 times", then understood it is flatten + reduce, and my lib already had flatten, so it was easy to fix). As for "inner product", I just haven't found suitable Ruby metaphor and fell back to zip+reduce, which seems to be equivalent.