racket/collects/honu/examples/List-test.ss
Carl Eastlund 365754f55c Honu:
- top.ss
  - commented out compile-failure tests for now
- cce-notes.txt
  - added my preliminary notes about the Honu codebase
- examples/*-test.ss
  - added *-test.ss files for all *.honu files

svn: r943
2005-09-29 16:14:54 +00:00

20 lines
595 B
Scheme

(define MT (new MTList%))
(define (Cons first rest) (new ConsList% [car first] [cdr rest]))
(define l0 MT)
(define l1 (Cons 0 l0))
(define l2 (Cons 1 l1))
(define l3 (Cons 2 l2))
(list (interface? List<%>)
(class? MTList%)
(class? ConsList%)
(send l0 List<%>-empty '())
(not (send l1 List<%>-empty '()))
(not (send l2 List<%>-empty '()))
(not (send l3 List<%>-empty '()))
(equal? (send l0 List<%>-length '()) 0)
(equal? (send l1 List<%>-length '()) 1)
(equal? (send l2 List<%>-length '()) 2)
(equal? (send l3 List<%>-length '()) 3))