Whiplash! A Snap! Mod

Not much has changed from original Snap! so far but I added (formerly library/custom) primitives like:

clamp () from () to () ::operators reporter // Accessed via relabelling MIN or MAX
sort $list ordering with(<>$>) ::list reporter
group $list by (()$>) ::lists reporter
(<>$>) applies to [any V] in $list ? ::predicate lists
multimap (()$>) over $list $:> ::list reporter

And more!
Tell me what you think!

How does the group block work?

It returns a new list of list such that the first item is a unique value, the second is the # of items matching the value when the key is applied, and the third a list of all the values matching.

Guys, what primitives should I add?

Reporter versions of list primitives, like this:

(just a suggestion though)

I like it!
There’s already a reporter for _ ADDED TO _ in this mod (_ FOLLOWED BY _), I think i’ll add INSERTED AT and REPLACING

They’re here! Check them out:
untitled script pic (54)

nice! These are great to have!
could you change all but last to accept a number input and dropdown?

Yeah, I’m planning special semantics for that, and merging ALL BUT FIRST OF and ALL BUT LAST OF.
Putting 1 returns all but the first element of a list,
but putting FIRST makes it a linked list.

yeah, that makes sense. How are you going to handle importing snap script pics with this change?

There’s already an “initBlockMigration” function, it’s used for deprecated blocks like

length of $list

(as opposed to)

[length V] of $list

In vanilla Snap!

I added it, but the variables category won’t load, and stuff like MY BLOCKS says:
cannot set properties of null (setting “isDraggable”)

I fixed it!
The new block:
untitled script pic (58)

I named it Whiplash!


The list icon is there because the mod is centered around lists mainly.

Does anyone know how to add morph representations of classes?
(e.g, Boolean is BooleanSlotMorph,
List is ListWatcherMorph)

I added a new primitive :)
untitled script pic (62)

What do you mean?

A primitive, like it’s now a primitive, non-custom block.

What?

In case it wasn’t clear, this was for a Snap! mod, not vanilla Snap!.