APL in R
bookdown.org
bookdown.org
The story I gave here was told to me way back in the day by RG himself, although the real reason R uses `<-` is "because that's what S does" and it's possible that the reason he was given wasn't 100% correct itself.
In the original Parc Place image, the glyph of the underscore character (_)
appeared as a left-facing arrow (like in the 1963 version of the ASCII code).
Smalltalk originally accepted this left-arrow as the only assignment operator.
[0] https://en.wikipedia.org/wiki/Smalltalk#AssignmentWhen I read this I said "huh?" because I used ASR33's quite a bit in my youth and I didn't remember that.
But, sure enough, the 1963 version of ASCII had the backarrow. It was replaced by underscore in the 1965 version. The backarrow would have been current when Iverson first developed APL.
all code here:
l0 ← 4 3 ⍴ 0 0 1 0 1 1 1 0 1 1 1 1
y ← 4 1 ⍴ 0 0 1 1
syn0 ← 3 1 ⍴ 0.5069797399 0.5703818579 0.9265880619
i ← 0
e ← 2.718281828459045
:While i < 10000 ⋄ i ← i + 1 ⋄ d ← l0 +.× syn0 ⋄ l1 ← 1 ÷ 1 + e * 0 - d ⋄ l1_err ← y - l1 ⋄ l1_delta ← l1_err × l1 × 1 - l1 ⋄ syn0 ← syn0 + (⍉ l0) +.× l1_delta ⋄ :EndWhile
l1if our all ML codes use apl, it will be a cool world.
No.
Also, this isn't, strictly speaking, six lines of code. The diamond is a statement separator. This is more like 15 or 20 lines (didn't count). Not that this is an important metric at all.
Font and keyboard settings work independently of Dyalog APL. (Thank you, btw, for that!) For example, I've used them with GNU APL.
I don't have an example, but here are some motivations: Read it because you're generally interested in how people use programming languages to solve their problems. Read it because you use R and would like to have a really nice way of talking about array operations. Read it because you use APL and you want access to all of the neat stats functions R provides.