Variadic if-else reporter

Considering the if <> { } @addInput block has been variadic for a while, I found it strange that the if <> then [] else[] block has stayed the same. I have way too many projects with much too many nested if <> then [] else[] s, which could have been much more elegant (and possibly faster) if we had this as a primitive.
Now, of course you can make this in snap, but of course it's slower, and the line spacing is fully messed up.

now, to make it look good, I think every if else case should be on a new line.
finally, here is the primitive definition

Yeah, that's a reasonable idea.

nice, that's good to hear.

On a similar topic, will if <> { } else { } be deprecated? It's now redundant.

I actually find myself using it more than ever. Where I used to say


I now prefer IF/ELSE because I find

uglier.

:laughing:
in your opinion, would if <> then [] @addInput else [] :: control reporter also be ugly?

Well, wouldn't it be if <> then [] else if <> []@delInput@addInput:: control reporter?

import the script pic (in the OP) and you'll see what I mean.
(there must be a default value because a reporter must report in snap)

But why is there an else case?

well, if every condition is false, then the reporter wouldn't report!

43 posts were split to a new topic: Discussion of UI principles

No, what I mean is: why is there an else case if the variadic if-else command doesn't have one?

They answered that: It's okay for a command block (such as IF) to do nothing, but it's not okay for a reporter (again, such as IF) not to report a value. Thus, the ELSE case is optional for the command, but required for the reporter.

Oops. Thank you.

Demo

I'm really confused; I already made a working one in the original post, does this to something differently?

It’s simplified: less input items. Plus it has a line break before every condition or potential result. I would’ve preferred a line break before every condition only, but I don’t think that’s possible with current Snap!

untitled script pic
Becomes


You just have to use "Expand" instead of "Separator".