12:49 AM
APLBUG online meetup in 10 minutes.
1:14 AM
@Adám Yeah, `(¯1+`1∾˜+⍟(9≥+)`⊸=)⊸⊔` is a full solution I think.
1:26 AM
`(¯1+`+⍟(9≥+)`⊸=)⊸⊔` is enough, output can't have empty groups so `1∾˜` to preserve trailing empty groups isn't needed.
@Adám Both it and this APL solution have the bug in that each leading 0 is split into its own group.
2:05 AM
An interesting parallel solution, `(10(≤+·{0=⊢´𝕩?𝕩;(×𝕩)+𝕩⊸⊏⊸+𝕊⊏˜𝕩}+⍋⊢)+`)⊸⊔`. Idea is to find, for each number, the index of the last number 10 less than it or smaller. These parent indices form a tree, and the depth in the tree is the group index. Depth is found with a recursive function that doubles depth at each round using select-by-self, `⊏˜`. This fails to separate the first two groups, which I brute-forced through by adding `10≤+``.
As to why tree depth gives the solution, the predecessor-index of a number that will end up being first in its group is the first number in the previous group (this is pretty much the definition of the indices), and depth can't decrease, because the predecessor-index can't decrease. That's not enough to prove that it works but it's the motivating principle. I haven't sorted out all the details, the simplest thing I tried just worked right away, except for the issue with the first two groups.
2:38 AM
That was not the right fix, the problem more like the first argument element is treated as 0. `{1↓⌾⊑ ({0=⊢´𝕩?𝕩;(×𝕩)+𝕩⊸⊏⊸+𝕊⊏˜𝕩}·10⊸+⊸⍋+`)⊸⊔ 0∾𝕩}` looks like it works, but there's probably something more elegant.
`(1↓·{0=⊢´𝕩?𝕩;(×𝕩)+𝕩⊸⊏⊸+𝕊⊏˜𝕩}·10⊸+⊸⍋0∾+`)⊸⊔` is better.

14 hours later…
4:59 PM
Maybe I'm missing something, but editing could be easier ...

There is apparently no configuration option to always undock the function editor window.
I wish there was, because my first editing step is always to undock it manually.

After undocking the function editor window,
it does not seem to apply when editing a function from the Explorer.
This worked well in version 17, but not in version 19.

Even worse, there is apparently no way to undock an edited function from the Explorer in version 19.
5:11 PM
Some annoyances with the function editor ...

There is no shortcut key for Fix in the function editor.
I always have to go through Menu, File, Fix.

The shortcut key "Num /" to Reformat does not exist on some keyboards.
I was unpleasantly surprised by this when I got a new laptop that has no num pad on its keyboard.

The function editor error message "Can't Fix" almost never says why.

After editing a function, the Explorer list often gets confused.
For example,
sometimes the same name is listed twice,

1 hour later…
6:17 PM
@drab thought this was the classic mode - on windows at least?
You can also change the shortcut to reformat or fix (codes <RD> and <FX> respectively via Keyboard shortcuts menu or programatically with ⎕PFKEY (help.dyalog.com/19.0/#Language/System%20Functions/pfkey.htm) - @Adam can probably help better there to automatically enable

4 hours later…
10:03 PM
0

This works in Dyalog APL but not in GNU APL: {10<⊃⍵:⍵ ⋄ ∇ ⍵,⍨+/2↑⍵}1 The error I get is Illegal : in immediate execution+ I am using the REPL but I tried running it from a file as well but it didn't work either. If something I am using is specific to Dyalog, what is the correct GNU way to do it?