You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
372 B
15 lines
372 B
|
|
Exercise 2.33: 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))
|
|
|