[plt-scheme] How to perform a union between two lists?

From: Robby Findler (robby at cs.uchicago.edu)
Date: Sun May 6 21:04:17 EDT 2007

On 5/6/07, Eli Barzilay <eli at barzilay.org> wrote:
> On May  6, Grant Rettke wrote:
> > Hi folks,
> >
> > What is the best way to perform a union between two lists?
>
> Simple, and not too efficient:
>
>   (append l1 (remv* l1 l2))

But if you're using lists to represent sets, you presumably aren't too
too worried about efficiency (and you can't really do a lot better
than that w/ lists anyway).

Robby


Posted on the users mailing list.