Search found 11 matches
- Tue Nov 08, 2011 3:25 pm
- Forum: Scheme
- Topic: reversing a list
- Replies: 3
- Views: 12630
Re: reversing a list
(define reverse-list (lambda ( l ) (define lasts (lambda ( l ) (cond ((null? (cdr l))(car l)) (else (lasts (cdr l)))))) (define onleft (lambda ( l ) (cond ((null? (cdr l))(quote ())) (else (cons (car l) (onleft (cdr l))))))) (cond ((null? (cdr l)) (cons (car l)())) (else (cons (lasts l) (reverse-li...