filtering out [sort of] repeated lists


    Mar 31 2009 | 6:42 pm
    so, say I have a stream of the following few lists:
    [1 0] [2 1] [3 0] [1 0] [7 1] [1 1] [3 0]
    now, the filter should be looking at the first item in each list. I would like the output to be:
    [2 1] [7 1] [1 1] [3 0]
    so, they're sort of x/y pairs.
    i looked at [funbuff], but still have repetitions with new sets of lists.
    see if this makes sense:

    • Mar 31 2009 | 11:53 pm
      What is the exact condition for whether a list gets passed or not? You said filtering out repeated lists but I can't see this from your example. Might just be me being a bit slow though!
      lh
    • Apr 01 2009 | 2:48 pm
      hi,
      the lists are two integers long, and can be thought of as x/y pairs, or an address and a value.
      if you look at the first message box: [0 1, 0 0, 0 1, 1 0, 2 0, 3 1, 3 0, 3 1, 4 1, 5 0]
      this is a bunch of two-value lists, sent out one by one, to simulate what's actually happening in my patch.
      notice the sequence: [0 1] [0 0] [0 1]
      this is what I mean by a repeat, list beginning with 0 happens three times. after all that I just want one message sent, with the latest version of that list, so:
      [0 1]
      does that make sense?
      combination of [funbuff] and [dump] works first time round, but not with successive passes. I guess I want [funbuff] with [dump only things that have changes since last dump].
    • Apr 01 2009 | 4:21 pm
      Hi, change the message [dump] with [dump, clear]
      m
    • Apr 01 2009 | 4:33 pm
      but [clear] erases the contents of funbuff?
    • Apr 01 2009 | 5:23 pm
      mmhh. I see, you want a pair to be filtered out if it was on the previous dump. This is not easy because funbuff has no way to know if a pair is in the first message box or in the next one: it only "sees" lists of two elements getting into its left inlet. Maybe you should use a coll and add a flag to a pair when it is dumped so that it is not dumped again.
      m