lisp2arx
Visual Programming for AutoLisp Mathématiques en programmation Lisp.. doc2cpp,doc2lsp, sld2lsp, bmp2dcl, free__GifCcapture for all-CAD'platforms..
Lista Forumurilor Pe Tematici
lisp2arx | Reguli | Inregistrare | Login

POZE LISP2ARX

Nu sunteti logat.
Nou pe simpatie:
i.oana din Bucuresti
Femeie
20 ani
Bucuresti
cauta Barbat
20 - 45 ani
lisp2arx / GnuLisp and CommonLisp / Commonlist - failed  
Autor
Mesaj Pagini: 1
zauchan
Moderator

Inregistrat: acum 13 ani
Postari: 180


Code:

(remove-duplicates (list "a" "b" "a" "a" "a" "c" "c"))
--> wrong (list "b" "a" "a" "a" "c" "c"))
--> good (lst "a" "b" "c")

(delete-duplicates (list "a" "b" "a" "a" "a" "c" "c"))
--> wrong (list "b" "a" "a" "a" "c" "c"))
--> good (lst "a" "b" "c")

(remove (list "a" "b" "a" "a" "a" "c" "c"))
--> wrong (list "b" "a" "a" "a" "c" "c"))
--> good (lst "a" "b" "c")
 
CL-USER> (remove  "a" (list "a" "b" "a" "a" "a" "c" "c"))
("a" "b" "a" "a" "a" "c" "c")
CL-USER> 
(dfn_dupdel  (list "a" "b" "a" "a" "a" "c" "c"))



(defun dfn_dupdel( l )
  (if (null l) nil
    (if (member (car l) (cdr l));;????
       (dfn_dupdel (cdr l))
       (cons (car l) (dfn_dupdel (cdr l)))
     )
  )
)

(remove-duplicates (list "a" "b" "a" "a" "a" "c" "c"
(remove-duplicates (remove-duplicates labc :test #'string :test #'string

(dolist x (list "a" "b" "a" "a" "a" "c" "c" (print x))
You replace equal with String
   https://stackoverflow.com/questions/793 ... rom-a-list


(Defun taskf3(lang / $rr)
  (if (null lang)
    (setq $rr nil)
    (setq $rr (if (and (= (car lang) (cadr lang)) (null (member (car lang) $rr)))
               (cons (car lang)  (taskf3 (cddr lang)))
               (taskf3 (cdr lang)))))
$rr)
(Defun taskf2(lang / $rr)
  (if (null lang)
    (setq $rr nil)
    (setq $rr (if (and (car lang) (cadr lang) (/= (car lang) (cadr lang)))
               (cons (car lang)  (taskf3 (cddr lang)))
          (if (car lang)
               (taskf3 (cddr lang))
            ))))
$rr)


(setq    labc   (list "a" "b" "a" "a" "a" "c" "c")
(princ (taskf3 labc))

          
(setq    labc   (list "a" "b" "a" "a" "a" "c" "c")
(taskf3 labc)

Modificat de zauchan (acum 3 ani)


_______________________________________
psw: cea de la wjndowsXP gigabyte..

pus acum 3 ani
   
Pagini: 1  

Mergi la