Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun odd_poz(x)
- (cond
- ((null x) nil)
- ((eq (mod (car x) 2) 1)
- (cond
- ( (> (car x) 0) (car x) )
- (t(odd_poz(cdr x)))))
- (t (odd_poz(cdr x)))))
- (defun oddpositive(x)
- (cond
- ((null x) nil)
- ((> (car x) 0) (cons (car x) (oddpositive(cdr(cdr x))) ))
- (t(oddpositive(cdr(cdr x))))))
- (defun join(x y)
- (cond
- ((null x) y)
- (t(cons (car x) (join (cdr x) y) ))))
- (defun evens(x)
- (cond
- ((null x) nil)
- ((eq (mod (car x) 2) 0)
- (join (car x) (evens(cdr x))))
- (t(evens(cdr x)))
- ))
- (defun last(x)
- (cond
- ((null (cdr x)) (car x))
- (t( last(cdr x)))))
- (odd_poz '(-6 8 11 4 -16 55 -11 85 88))
- (oddpositive '(-6 8 11 4 -16 55 -11 85 88))
- (evens '(-6 8 11 4 -16 55 -11 85 88))
- (last '(-6 8 11 4 -16 55 -11 85 88))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement