sicp-solutions/ex-2.21.scm
Petar Kapriš da96368e0b Add solutions to exercises from subsection 2.2.1
In exercise 2.17, there is an error with the test on hexlets site, which
should be reported to them.
2025-02-06 11:08:54 +01:00

11 lines
213 B
Scheme

#lang sicp
(define (square x) (* x x))
(define (square-list items)
(if (null? items)
nil
(cons (square (car items)) (square-list (cdr items)))))
(define (square-list2 items)
(map square items))