about summary refs log tree commit diff stats
path: root/js/games/nluqo.github.io/~bh/61a-pages/Lectures/errors
blob: 825b0ecf72c4ac31c91fce89637bca9514dc3ac7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
(define (list-of-squares nums)
  (define (square (car nums))
    (* (car nums) (car nums)))
  (if (null? nums)
      nil
      (cons (square (car nums))
	    (list-of-squares (cdr nums)))))




(set! (cdr x) nil)





(define (assq sym alis)
  (cond ((null? alis) nil)
	((eq? sym (caar alis))
	 (car alis))
	(else
	 (set! alis (cdr alis))
	 (assq sym alis))))