

thoughts and feedback appreciated :)
I love it!
The only problem is that if you add more than one ELSE IF clause the block becomes infinitely wide, and doesn't line break well:
(I guess because Snap! is treating the entire multi-line variadic group as a single block for the purpose of wrapping the entire block.)
So I tried changing the "expand..." text to "$nl else if" but that didn't work (I'm guessing you tried it too...). I also tried "%nl" because there was a post somewhere about a feature using that; the result was that it broke the block and also made it so I could no longer click OK to close the block editor. I have filed a github issue about all this.
PS I think the RESHAPE is fine. I'm sure there's another way to do it, but whatever it is, it'll be slower.
this block doesn't work because you use RESHAPE. Just leave it out, and it'll do what you want it to do! (the "else pairs" already are a 2D table, no need to reformat them again)
oh haha I didnt realize that change was made
I haven't seen that happening.
Snap actually handles the entire variadic group as it's own thing. First, it gets the full width, and since it's greater than the max width, it puts it onto a new line. Then the variadic group itself does it's own wrappung.
I figured it all out while making snapblocks, however I can't exactly make it the same behavior, since snapblocks doesn't have variadic groups.
Yeah that's what I meant. I think that's right in principle but problematic in the example I posted. To a naive user (such as me) that "else" floating all by itself at the right margin is (a) easy to miss, as I did when first saw this example, and (b) ugly, because its baseline isn't the baseline of the bottom line of the variadic block.
I think that's actually easy to fix, with the following rule: If you put a line break before the variadic group, also put a line break after it. I would also add another improvement: Try to break lines inside a variadic group at a group boundary. In my example above, that means to start the line that now starts with THEN with the previous ELSE IF instead.
I think Jens is (and maybe you are too) mentally seeing a box around the variadic group:
Note how that makes the baseline of the ELSE look good instead of bad. But we naive users don't have that mental box in our heads. :~)
That's actually pretty much how it's done in the code itself (a variadic input is its own morph, the inputs in the variadic input are not direct children of the block, unlike regular inputs).
ok sticking with the theme of new group blocks heres a switch block (but I edited the words for people that dont know what it is already)
Here is what I came up with, which I think is easier to read.
However, it comes at the price of it not being as clear what it's behaviour would be when multiple cases are true (because it lacks the "else if" label).