@ -33,6 +33,13 @@
(define (sum numbers) (reduce numbers + 0))
(define
(repeat value number)
(if
(= number 0)
'()
(cons value (repeat value (- number 1)))))
(define (is-numeric-char char) (if (char-numeric? char) #t #f))
(define (first-last list predicate)
@ -43,7 +50,7 @@
(cons
(predicate (car list))
(cons (car list) (cons (car list) '()))
(repeat (car list) 2)
'())
(first-last (cdr list) predicate))
(lambda (current rest)