More list nodes — sort, find occurrences of an item, remove duplicates

.

On sorting…

It would be fantastic to be able to optionally define a sorting algorithm, à la JS Array sort.

Perhaps with two separate sort nodes, one to deal with basic sorting of Integers, Real Numbers, Text, etc., and one to deal with custom sorts.

Mockup:

1 Like

Custom sorting would ideally be implemented on top of Ability to pass entire subcompositions into other nodes via cables (function ports / lambdas / closures), but, until then, your mockup might be the best way to support it.

The mockup follows the pattern of Process List and Build List. I wonder if that would be a problem — I mean, since a lot of people get confused about Process List and Build List. Maybe not as much of a problem, just because it’s a more specific node and wouldn’t be as commonly used. In any case, I’m wondering if there are any other possibilities for implementation.

Would the comparison result as signed integer be confusing to people without a programming background? I do think it’s a better option than having the result as a boolean (as in C++), which has the pitfall of requiring a strict weak ordering.

1 Like