Re: sorting a list based on the order of its items in another list

2017-12-12 Thread Deyan Yotsov
Thank you very much, Ray Miller and Gary Trakhman! On 12/12/2017 02:32 PM, Ray Miller wrote: Very similar to your solution: (filter (set small-list) big-list) On 12 December 2017 at 13:24, Deyan Yotsov > wrote: Hello, I have one list of potentially up to 2 m

Re: sorting a list based on the order of its items in another list

2017-12-12 Thread Ray Miller
Very similar to your solution: (filter (set small-list) big-list) On 12 December 2017 at 13:24, Deyan Yotsov wrote: > Hello, > > I have one list of potentially up to 2 million strings: big-list. > > Then I have another list, small-list, the elements of which are a subset > of the elements of big

Re: sorting a list based on the order of its items in another list

2017-12-12 Thread Gary Trakhman
How about (filter (set small-list) big-list) ? On Dec 12, 2017 8:25 AM, "Deyan Yotsov" wrote: > Hello, > > I have one list of potentially up to 2 million strings: big-list. > > Then I have another list, small-list, the elements of which are a subset > of the elements of big-list. > > I want to s

Re: sorting a list based on the order of its items in another list

2017-12-12 Thread Deyan Yotsov
PS: I just realized that the code, as I wrote it, will not work, as nesting of # is forbidden. My actual code is: (defn is-element-in-list [e l]   (some #{e} l)) (filter #(is-element-in-list % small-list) big-list) Sorry about that. Deyan On 12/12/2017 02:24 PM, Deyan Yotsov wrote: Hello,

sorting a list based on the order of its items in another list

2017-12-12 Thread Deyan Yotsov
Hello, I have one list of potentially up to 2 million strings: big-list. Then I have another list, small-list, the elements of which are a subset of the elements of big-list. I want to sort the elements in small-list so that they become sorted in the same way in which they are sorted in big-