in ANTLRish syntax a way would be to have a "(" expression ")" alternative beforehand to catch no-separators before it gets to touch them, but i'm not sure there's any formal specification of that
@Adám I can't come up with something pretty that allows AB, BA and ABA without allowing B; maybe @dzaima is right and you have to go with |ing several options
@Adám 1) we have strands (and soon array notation); 2) have you ever actually had a case where you can't strand (or no other array creation alternative is better) but are absolutely guaranteed ≥2 items?
(using , to build arrays is only "correct" when either you have simple scalars and 2+ items, or you have a starting ⍬/''/⍮X)
@dzaima I was just about to say that that's the general form, but without that primitive, not allowing the concatenation of scalars would be very problematic. You couldn't even define ⍮←,⍥⊂ then, but would have to resort to a dfn {⍺⍵}.
@Adám - Point taken; I didn't view dfns and MSDs as different because they both existed when I first became aware of them. But the proliferation of function definition syntaces is the issue.
One might argue that unparenthesised trains shouldn't have been allowed in the first place. I think NARS2000 prohibits them. And then the extension to multi-statement wouldn't be so controversial, I think.
@Adám Interesting distinction between powerful and useful/convenient there. Nub Sieve is powerful since it's otherwise difficult to do correctly and impossible to do efficiently, but 0≠ comes up so much more often.
there have been ±5 separate times i've considered adding ⍳∘≢ to dzaima/APL; a couple ended with no symbol found, a couple with worries about ⍳∘⍴, and a couple with falling asleep
@dzaima Somewhat related to ⍳∘≢ versus ⍳∘⍴, another problem I've been having is trying to figure out what kind of return value Indices should have. BQN2NGN keeps the inconsistent Dyalog behavior.
@Marshall i don't think distinguishing on rank is that bad of a crime. (personally i always code with consistent, known rank everywhere so i've had no issues)
@dzaima It's a way to use the same symbol for two different functions. Eventually, you will want one of the functions in a context where you can't use it.
There are some reasons to force vector indices everywhere. ⊏ would be able to do scatter-cell indexing easily: if the argument is a numeric array, its rank must be at least 1 and its rows are cell indices. If it's a vector of numeric arrays, then you take the cartesian product of rows from all index arrays.
@Marshall if i want specifically a vector of 1-item vectors of simple scalars, 1) i'm probably doing something stupid; 2) ,¨ is not that hard to use (similar logic for me special-casing f/vec)
(can't comment on ⊏/⌷, i've never had any reason to use it beyond the simple case of a vector left arg)
@dzaima That goes the other way too. If you have scalar indices, just use ⥊⎉0⊸⊏. Is the power of vector indices worth making scalar indices inconvenient?
@Adám thanks to a conversation between you and dzaima I found out about the wonders of pinned tabs... now I keep a couple of tabs pinned for good measure; this one included
∘ Built-in language bar ∘ Selectable font (APL385, Iosevka, DejaVu Sans Mono, SAX2) ∘ TIO integration in chat and posts ∘ Real APL syntax colouring ∘ APL Wiki integration (when APL Wiki upgrades to the newest MediaWiki)
@RGS Well, before we open it up, we have to decide on the scope.
∘ Dyalog only ∘ APL only ∘ APL-like (including e.g. BQN and J) ∘ All array languages (Mathematica, MATLAB, NumPy,…)
yeah, when I hit CTRL+BACKSPACE to delete a whole variable name or a whole sequence of consecutive chars and I see that character instead, I do go "uff"
There are lots of oddities that show that the IDE isn't a text editor: Pressing delete at the end of the line doesn't bring the next line up, you can position the cursor beyond the end of a line, etc. etc.
This is where readline comes in handy: "As a cross-platform library, readline allows applications on various systems to exhibit identical line-editing behavior." That's also what I like about my current lisp implementation.
@Wezl Nevermind, the nice features readline might offer would probably conflict with typing special characters (CTRL+E for end of line would mess with typing epsilon, for example)