The title says it all, how would you break up a list or an array into its distinct elements, with no repetition?
-
How to create a set from an array?
-
@fefffffff list-unique from list-abs will do that
-
@seb-harmonik.ar I was thinking of a vanilla method to do this, but might try that as well.
-
@fefffffff list-abs is made up of vanilla abstractions.
-
@fefffffff You could also use this. It is the same idea as [list-unique] from list-abs. Maybe a little bit faster. Not so much tested, but should probably work:
Edit: Some bugs fixed...
-
@oid oh, I see... nice! thank you.
-
@ingox I will try that one too! Thanks!
-
@fefffffff Surprisingly enough, this version that uses [text] is even faster:
-
For longer lists, my first solution is slower than the one from list-abs, but the one using [text] is a lot faster...
When more occurrences are allowed, the difference gets even larger.
-
@ingox gonna try that one! thank you!