Hello!

  I have a tuple that contains a file path in its `path` slot. And I have two 
sequences of such tuples, representing two states of a disk.

  I want to know which files were added, which were removed, and which remained 
between the two states. Only paths are to be considered by the analysis, but 
the resulting sequences should consist of the source tuples, not merely path 
strings.

  Here's what I came up with:

```
: paths-diff ( old new -- seq )
    [ [ dup path>> swap 2array ] map >hashtable ] bi@ assoc-diff values ;

: paths-deleted ( old new -- seq ) paths-diff ;
: paths-added ( old new -- seq ) swap paths-diff ;
```

  Then I thought that creating the assocs every time I need to diff is perhaps 
not very bright.

  Is it possible to partition an assoc in a way similar to the way the 
`partition` word splits a seq into trueseq and falseseq?
  Do we have a word to partition a set or an assoc three-way: left-diff, 
intersection and right-diff?

---=====---
 Александр

------------------------------------------------------------------------------
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to