learning-sicp

My embarrassing half assed SICP run.
git clone https://kaka.farm/~git/learning-sicp
Log | Files | Refs

exercise-18.scm (287B)


      1 ;; Exercise 2.18
      2 
      3 (let* ([reverse
      4         (lambda (xs)
      5           (cond
      6            ((null? xs) '())
      7            (else (append (reverse (cdr xs))
      8                          (list (car xs))))))])
      9 
     10   (test-begin "2.18")
     11   (test-equal
     12       '(3 2 1)
     13     (reverse '(1 2 3)))
     14   (test-end "2.18"))