(defun swap2(x) (cond ((null x) nil) ((= 1 (list-length x)) (append x) ) (t (append (list (cadr x)) (list (car x)) (swap2 (cddr x))) ) ) ) (setq x '(1 2 3 4 )) (write (swap2 x)) (defun pairup (x y) (cond ((and (null x) (null y)) nil) ((null x) (append(list (append '(-1) (list (car y))))) ) ((null y) (append (list (append (list (car x)) '(-1) ))) ) (t (list (append (list (car x)) (list (car y))) (pairup (cdr x) (cdr y)) )) ) ) (terpri)(terpri) (setq y '(11 12 13 14 15)) (write (pairup x y))
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more