# list.rb # This is not a test program but is required for the test programs to run using # Ruby. It defines several functions on lists. def cons (head, tail) [head] + tail end def head (list) list [0] end def tail (list) list [1, list . length] end