Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define first-of-three
- (lambda (a b c)
- (cond
- ((or (null? a) (null? b) (null? c)) #f)
- (else (list (car a) (car b) (car c))))))
- (define prependl
- (lambda (l r)
- (cond
- ((null? l) r)
- (else (cons (car l) (prependl (cdr l) r))))))
- (define revl
- (lambda (l)
- (cond
- ((null? l) l)
- (else (prependl (revl (cdr l)) (list (car l)))))))
- (define palindrome
- (lambda (l)
- (prependl l (revl l))))
- (define union
- (lambda (a b)
- ()))
- (define intersection
- (lambda (a b)
- ()))
- (define difference
- (lambda (a b)
- ()))
- (define duplicate
- (lambda (l)
- (cond
- ((null? l) l)
- (else (prependl (list (car l) (car l)) (duplicate (cdr l)))))))
- (define suffixes
- (lambda (l)
- (cond
- ((null? l) l)
- (else (prependl (list l) (suffixes (cdr l)))))))
Add Comment
Please, Sign In to add comment