2.2.3. Sequences as Conventional Interfaces
Exercise 2.33

List-manipulation operations as accumulations

Fill in the missing expressions to complete the following definitions of some basic list-manipulation operations as accumulations:

(define (map p sequence)
  (accumulate (lambda (x y) <??>) nil sequence))

(define (append seq1 seq2)
  (accumulate cons <??> <??>))

(define (length sequence)
  (accumulate <??> 0 sequence))


There are no comments yet.

Authentication required

You must log in to post a comment.

Login