Jump to content

removing duplicates in a list


Recommended Posts

Posted (edited)

problem solved

 

typo :oops:

(vl-sort lst '

Edited by Lt Dan's legs
Posted (edited)

Your question is not clear .

Is this what you mean .

 

(setq elist (list 5 2 4 1 3))    
(vl-sort elist '<)
;;;-> Return ;[b][color="red"] (1 2 3 4 5) [/color][/b]

 

Tharwat

Edited by Tharwat
Result of codes added
Posted

It was a typo. but not on this part. I thought for sure this was giving me the error

Posted
Your question is not clear .

Is this what you mean .

 

(setq elist (list 5 2 4 1 3))    
(vl-sort elist '<)
;;;-> Return ;[b][color=red] (1 2 3 4 5) [/color][/b]

Tharwat

 

FYI:

(vl-sort '(5 4 2 3 6 7 7 7) '[/b] (2 3 4 5 6 7)

Posted
(defun LM:Unique ( l )
 (if l
   (cons (car l)
     (LM:Unique (vl-remove (car l) (cdr l)))
   )
 )
)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...