OOP objects with mismatched key-value pairs

  1. Load the OOP library.
  2. Grab the (object ((field)) : [[thing]] @> ::lists) block.
  3. Expand it to add one more key-value pair.
  4. Right-click on an upvar and choose “delete variable”.

Right-click on an upvar and choose “delete variable”.

Good grief. Did this actually happen to you accidentally, or are you looking for ways to break Snap! deliberately?

This just seems more like a user error than a bug

I feel like this is both a user error and a snap error. Why would users delete a variable, but another question is, why would snap even show the option?

I am used to removing upvars in the script variables ((a)) @> block, because order matters! It also works properly with other variadic blocks like (() + () @<:>). I assumed it would work for key-value inputs too, but surprisingly, not that one. I wanted this bug fixed, because I want to be able to properly sort the variables this block and the let ((a)) $arrowRight [] @> block.

No offense, but why are you being harsh with a valid bug report? I am not the person who complains or boasts about being able to get into Morphic menus to ringify a custom block definition (w/ the prototype hat) and smuggle it out the block editor. (realized that was on me for not explaining earlier)

In the case of the (object ((field)) : [[thing]] @> ::list) block:

What if I no longer need a key-value pair, but it is located amid other pairs that are needed?

There should be a way to remove that pair without having to manually push the following ones up by one by renaming the keys and dragging blocks that are slotted as values and/or copy-pasting text/numbers.

The expected behavior is that both the key and the value in that pair gets removed with the “remove variable” option, not just the key upvar.

That’s actually pretty valid. Snap already allows you to delete slots in regular variadic inputs, so it would be good, and useful in this case, to be able to delete a whole variadic input group par. But if the snap devs don’t want to do that, then the bare minimum is to just remove that “delete variable” option for stuff like this.

No offense, but why are you being harsh with a valid bug report?

You’re right; I apologize.

But, “delete variable” to me suggests, you know, deletebutton. What you want to do isn’t to delete a variable altogether, but delete its use in this input slot, like


That’s why I didn’t understand why you would want to do what you did!

Also I agree with

That would make more sense than deleting just half of a field.