Write a Scheme function called build-list-increasing that builds and returns a list of increasing numbers. Here are a couple functions that implement this behavior.
(define (build-list-increasing x)
(define (build-list-increasing-helper x max)
(if (> x max) ()
(cons x (build-list-increasing-helper (+ 1 x) max))))
(build-list-increasing-helper 1 x))
(define (build-list-increasing x)
(if (< x 1) ()
(append (build-list-increasing2 (- x 1)) (list x))))
(define (alist-add-replace key val alist)
(if (null? alist) (list key val)
(let ((rest (alist-add-replace key val (cdr alist))))
(if (eqv? key (alist-first-key alist))
(cons (list key val) rest)
(cons (car alist) rest)))))
(define (alist-add-replace key val alist)
(alist-add key val (alist-remove key alist)))
(define (alist-remove key alist)
(if (null? alist) ()
(let ((rest (alist-remove key (cdr alist))))
(if (eqv? key (alist-first-key alist))
rest
(cons (car alist) rest)))))
(define (alist-keys val alist)
(if (null? alist) ()
(let ((rest (alist-keys val (cdr alist))))
(if (eqv? val (alist-first-val alist))
(cons (alist-first-key alist) rest)
rest))))
(define (alist-map alist fn)
(if (null? alist) ()
(cons (fn (alist-first-key alist) (alist-first-val alist))
(alist-map (cdr alist) fn))))