summaryrefslogtreecommitdiff
path: root/coding-exercises/2/21.rkt
blob: 9ad880c02659e06392ccf7313b83937988cc3146 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#lang racket
(require sicp)
(require "../../shared/chapter1.rkt")

(define (square-list items)
  (if (null? items)
    (list)
    (cons (square (car items)) (square-list (cdr items)))))

(square-list (list 1 2 3 4))

(define (square-list items)
  (map square items))

(square-list (list 1 2 3 4))