University of Washington • CSE583 • D. Notkin
©
2000
16
List creation
l
cons
adds a cell at the beginning of a list, non-
destructively
–
Remember, in the functional world, we don’t destroy
things (which would be a side-effect)
l
(define fork (cons 4 snork))
–
fork
®
(4 5 6 7 8)
–
snork
®
(5 6 7 8)