Why can I check or x slots in some operators?

Instead of putting something in an “and” or “or” operator, I can click on the empty slot to give it a green check or a red x. What does this mean?

Those inputs are boolean inputs. The green check means true, and the red x means false.

What is being true/false if the slot is empty? Or does it remember it’s boolean state even if you put a reporter inside?

It’s just useful for testing things out.
If there are reporters or variables in the slots - their values will be used instead

The number 0. In IF statements, etc, it behaves as false though.

The number 0. In IF statements, etc, it behaves as false though.

This answer, while technically correct, doesn’t really tell the OP what they need to understand, imho.

An empty Boolean input slot, like any empty input slot, means that you, the user, haven’t (yet) provided a value expression for that input. It’s like asking what the empty input slots in the untitled script pic (7) block mean. They, too, have the implicit value 0 if you actually run the block without filling the input slots, but typically you don’t do that, so the issue doesn’t really arise.

A more advanced exception to this answer

In Snap!, leaving an input slot empty on purpose does mean something, namely, you are using the block in the context of a higher order function, which automatically fills that input slot with values from, typically, the items of a list:

This usually only happens in something like ( ) - (num), to convert (num) to a negative

I prefer explicit input names.


Use ((0) - (num)), ((num) * (-1) @<:>) or ([neg V] of (num)) instead.


A real use would be for secondary functionality in primitives, like that say [] hides speech bubbles or ask [] and wait closes all current ask prompts.

A real use would be for secondary functionality in primitives, like that say [] hides speech bubbles or ask [] and wait closes all current ask prompts.

Good point, that’s another use.

17 posts were split to a new topic: Monadic minus vs. NEG OF