Skip to content

Instantly share code, notes, and snippets.

@yakreved
Created August 15, 2013 20:14
Show Gist options
  • Save yakreved/6244388 to your computer and use it in GitHub Desktop.
Save yakreved/6244388 to your computer and use it in GitHub Desktop.
sicp 2.21
(define (square-list items)
(if (null? items)
()
(cons (* (car items) (car items)) (square-list (cdr items))))
)
(define (square-list1 items)
(map (lambda (x)(* x x)) items))
(square-list (list 1 2 3 4))
(square-list1 (list 1 2 3 4))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment