Similarly, the lines assignment needed to be {⍵⊂⍨0=9|⍳≢⍵}⍤1⍉bymonth.
After those changes it worked OMM, but the month names were appended directly to the end of the first Saturday's date with no space (e.g. "1 2January"). So I changed ↑months to ↑(' ',¨months) in the last line to insert a space there (there's likely a better way to do that; I'm still pretty new at APL).
I added `-h` to make sure `cal` didn't highlight today's date, which can throw things off, and eliminated intermediate vars that were only used once; this was what I wound up with (works from a clean ws in Dyalog OMM):
⎕io ← 0
lines ← {⍵⊂⍨0=9|⍳≢⍵}⍤1⍉{⍵⊂⍨0=22|⍳≢⍵}⍤1↑1↓⎕sh 'cal -hy'
months ← ~∘' '¨,⍉⊃¨lines
days ← ∊⍤1⍉{⍵/⍨(' '∨.≠¨⍵)∨∧\' '∧.=¨⍵}⍤1⍉¯1↓(23⍴1 0 0)⊂⍤1↑⊃,/,⌿2↓¨lines
⎕←53↑(¯2↓⍤1⊢days) , ↑(' ',¨months)\⍨∨/' 1 '⍷daysPotentially cal -y on macOS produces a different shape? What's ⍴↑cal?
Try doing cal←⎕SE.UCMD'Calendar 2021' and replace ↑2↓cal with 1↓cal - potentially that'll work?
What system are you on? On Ubuntu, cal -y | wc -l also gives me 36.
I'm decent with sed. I wouldn't call myself an expert, but know how to employ addressing and hold spaces, which are sadly aracana to most people who employ sed. I ended up learning sed because it was there, proved useful, and it fit into the command-line toolkit really well. (In order of importance.) APL would never slot into that toolkit as well as other tools, but it's value-add would more than compensate. Unfortunately, the value-add isn't enough to compensate for the fact that it's not there and in your face every time you're exploring a problem and its solution space.
https://en.wikipedia.org/wiki/APL_(programming_language)#GNU...
> (...) Richard Stallman, founder of the GNU Project, was an early adopter of APL, using it to write a text editor as a high school student in the summer of 1969.
And:
Rho, rho, rho of X
Always equals 1
Rho is dimension, rho rho rank.
APL is fun!
Richard M. Stallman, 1969
https://www.gnu.org/software/apl/But:
> GNU APL was written and is being maintained by Jürgen Sauermann.
and I believe it's fairly young when compared to emacs/emacs lisp.
I think the major issue is that APL seems to require more than ASCII to work it.
Yet, here we are. I'm still amazed to see people using it, and even more amazed to see someone break it out for some toy play.
Still, not gonna learn it. I like my hair.