Sum block can have 1 input by shift-clicking delInput

How to replicate:

  1. Drag a sum block, add new inputs until it has 4 inputs.
  2. Shift-click left triangle to delete 3 inputs at once.

Expected Behavior

The sum block is set to 0 inputs.

Observed Behavior

The sum block is set to 1 input, which shouldn't be possible.

Attachents:

untitled script pic

untitled script pic (1)

@bh

There's no need to ping bh, as he sees everything on the forum no matter what. You just have to be patient.

...I mean might as well.

Don't look at me; I think it's a feature. If it were up to me, it'd let you do that non-shift-clicking, too. ;~/ Not that there's really a use for one input slot; it just feels weird to me that there's this sudden jump when downsizing through two slots. Jens'll probably change it, though.

I think this has been mentioned before, a sum with one input is just the identity function.

it does this for any block like this. and you can do it right or left too! good to know...

Wait, I just thought of something. Could this be used to get a NEGATIVE amount of inputs?

No, because that's not how it works.

:frowning:
:-(.

C'mon, what would that even mean? What would it look like?

I don't know. Maybe reversed?

A variadic input is just a list, and a list cannot have a negative length, so it would be impossible to have a negative amount of inputs in a variadic input.

The slots in question are all part of the same variadic input. And, by hypothesis, the user is typing them in one by one, not using the INPUT LIST feature.

... Ok, maybe the list is backwards?

Huh. I never knew that.

Wait, what? This isn't an obscure fact about how Snap! works. We're talking about they hypothesis you raised: The user shift-leftarrows past zero inputs. The left and right arrowheads are associated with a variadic input; that's what those arrowheads mean. You knew that. You are proposing that there were one or two slots visible when the user shift-leftarrows. That's the hypothesis in this (silly) discussion!

...No not what I meant. Plus, when I said "reversed" I meant take the normal block and mirror it.

Oh.

Yeah, mirror as in "the arrows are on the left side instead of the right side, and the block extends to the left instead of the right".

As seen with a block from one of @ten_6044's projects: Weird blocks script pic
Sum blocks with negative input amounts just look like a sum block with zero inputs. There doesn't seem to be much of a difference in the way they behave either, because they both report the same thing and both extend to a sum block with two inputs when the right arrow is clicked.