EVERY/SOME as a primitive or in a library

So Snap!'s goal is to add a small amount of primitives to be able to create a big amount of custom blocks. The primitives MAP, FILTER, FIND, REDUCE, FOR EACH are there for speed. But often-times when I’m building list blocks I feel like an EVERY/SOME block is missing. I have to manually make a slow, inefficient script to check. So I suggest to either

  • add a new primitive for speed
  • add a new extension for the same purpose and add it to the list utilities library

What does an every/some block do?

Reports if a predicate function applies to every or any item in a list e.g, some of [1, 2, "foo"] could pass IS [] A NUMBER? but not every.

Are ypu looking for variadic hyperized untitled script pic - 2026-03-15T181759.419 untitled script pic - 2026-03-15T181804.366 ?

After dropping a list on variadic selector (arrows).

untitled script pic - 2026-03-15T181705.675
untitled script pic - 2026-03-15T181708.334

used this way
untitled script pic - 2026-03-15T182615.455
untitled script pic - 2026-03-15T182613.291

Many functions are already hyperized


.

untitled script pic - 2026-03-15T184237.943
untitled script pic - 2026-03-15T184235.346

I feel like since these functions are super easy to recreate using existing hof primitives, they wouldn’t actually be slow.

(this was optimized for speed)

However it looks like mapping over it and using any is actually faster


Though the benefit my custom block has over the second way, is that it doesn’t run anything extra if an item is found. The map method always maps over the entire list no matter what.


It’s a bit of a pick and choose situation here. If you anticipate having the value in the list more often than not, then it might be faster with my custom block. But if you anticipate not having it a lot, then it might be faster with the map method.

My custom block is also designed so that you can have empty values in the list (and check for them), but if you don’t, it’s much much faster to just use FIRST OF directly (no creating a new list of indices).

Basically I’m trying to say, most of the time, we don’t need a primitive for speed, in fact, this block would actually be just as fast as FIRST OF. It only becomes necessary if lots of people are using it, and you can’t get the same effect any other way.


Side note

This is not hyperblocks, this is just a variadic input. Hyperblocks is inputting a list, doing the operation on every item, and returning a new list.

You are right, it’s important distinction as AND, OR works both ways