Union of two lists

Discussion of Common Lisp
Post Reply
ayaz2010
Posts: 1
Joined: Sun Jan 30, 2011 10:02 am

Union of two lists

Post by ayaz2010 » Sun Jan 30, 2011 10:43 am

Hi Everybody,

I am quite new to this forum and also i am university student (first) year. so i am doing any mistake in asking question please forgive me.
how will we union two lists in a way that the elements that are repeated in the list will come only once in the new union list????

FAU

Re: Union of two lists

Post by FAU » Sun Jan 30, 2011 12:51 pm

(remove-duplicates (union '(1 1 2 3) '(2 2 3 4)))
=> (1 2 3 4)

Post Reply