learning-sicp

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

doubly-linked-list.scm (468B)


      1 (define-library (sicp tests doubly-linked-list)
      2   (import (scheme base))
      3 
      4   (import (srfi :64))
      5 
      6   (import (prefix (sicp solutions 3_23 doubly-linked-list) dll:))
      7 
      8   (begin
      9     (test-begin "doubly-linked-list")
     10 
     11     (define l1 (dll:make-link 1))
     12 
     13     (test-equal
     14         '(1)
     15       (dll:doubly-linked-list->list l1))
     16 
     17     (test-equal
     18         '(1 2 3)
     19       (dll:doubly-linked-list->list (dll:list->doubly-linked-list '(1 2 3))))
     20 
     21     (test-end "doubly-linked-list")))