filter?

Pete pete at mollysrevenge.com
Thu Jun 23 01:58:53 EDT 2011


I may be wrong, but I don't think intersect solves the problem.  If I
understand the dictionary correctly, this will remove all the t1 keys that
do NOT match t2 keys so it does the opposite of what is needed.  Even if
intersect does remove t1 keys that DO match t2 keys, that won't help find
values in t2 that are not present in t1, so 5 in his original example would
be missed.

The sort solution seems to work but would it be necessary to set
wholeMatches to true?  If you had two lines:

100
1001

... would 100 be taken as a duplicate with wholematches set to false?  Can't
tell from the dictionary.

Pete
Molly's Revenge <http://www.mollysrevenge.com>




On Wed, Jun 22, 2011 at 10:02 PM, Mark Wieder <mwieder at ahsoftware.net>wrote:

> Dick-
>
> Wednesday, June 22, 2011, 9:19:57 PM, you wrote:
>
> > Even though it may not always be the fastest, lean code has some appeal:
> there's no loop.
>
> > function intersectionOfLists t1, t2
> >    split t1 by cr and tab
> >    split t2 by cr and tab
> >    intersect t1 with t2
> >    return the keys of t1
> > end intersectionOfLists
>
> ! Thanks ! I was wracking my brain trying to figure out how I could
> apply split in this situation. I *completely* forgot about the
> intersect command,
>
> --
> -Mark Wieder
>  mwieder at ahsoftware.net
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>



More information about the use-livecode mailing list