In exercise 2.17, there is an error with the test on hexlets site, which should be reported to them.
9 lines
199 B
Scheme
9 lines
199 B
Scheme
#lang sicp
|
|
|
|
(define (reverse lst)
|
|
(define (rev-aux lst acc)
|
|
(if (null? lst)
|
|
acc
|
|
(rev-aux (cdr lst) (cons (car lst)
|
|
acc))))
|
|
(rev-aux lst '()))
|