learning-sicp

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

exercise-14.scm (310B)


      1 (define-library (sicp solutions chapter-3 exercise-14)
      2   (import (scheme base))
      3   (export mystery)
      4 
      5   (begin
      6     (define (mystery x)
      7       (define (loop x y)
      8         (if (null? x)
      9             y
     10             (let ([temp (cdr x)])
     11               (set-cdr! x y)
     12               (loop temp x))))
     13       (loop x '()))))