looking for an object

Discussions, advice, bug reports and much more about the "bach" environment.
Post Reply
ernopolo
Posts: 151
Joined: Sun Sep 16, 2012 6:55 pm

looking for an object

Post by ernopolo » Mon Apr 17, 2017 11:33 pm

hello!

I'm looking for an object which filters out all duplicate elements from a data stream, remembering each one which passed through, not letting any of them through for a second time until it's reset.
does it exist?

or should i just use collect, thin and iter at the "reset" moments...? it would work in some cases. anyway, i'm courious if this long-term-memory-bach.change exists.

best,
E

danieleghisi
Site Admin
Posts: 1349
Joined: Fri Dec 03, 2010 1:25 pm

Re: looking for an object

Post by danieleghisi » Tue Apr 18, 2017 9:56 am

You should be able to do that just with [bach.collect @autoclear 0] and [bach.belong].

ernopolo
Posts: 151
Joined: Sun Sep 16, 2012 6:55 pm

Re: looking for an object

Post by ernopolo » Tue Apr 18, 2017 7:47 pm

bach.belong - thanks! it was completely out of my sight. i was laming around with bach.intersect for such cases, but this seems more simple.
best,
E"

Post Reply