Weird arithmetic blocks

These blocks look weird to me:
Snap! Weird blocks (

Right, so, as of the latest Snap! version, + and × are variadic -- you can change how many inputs they take.

When you use JOIN with a variadic-input block, it will give the resulting block exactly as many inputs as there are input slots in the one you give it:


But sometimes that's not what you want, because you don't know until your program is running how many inputs you'll want the result block to take. So as a workaround, if instead of a bunch of input values you give JOIN a list whose first item is a small integer, it'll make a block with that many input slots:

The list items other than that initial number provide the input expressions to put into the slots, but if there are more or fewer, then you get empty slots or unused input values.

The list items other than the first don't have to be literal numbers; they can be arbitrary expressions:

This all takes some getting used to, but it lets you do what you want!