module Hamster::List

def accessor(sequence)

'd's appear is the inverse of the order in which the corresponding operations are performed.
identify the series of car and cdr operations that is performed by the function. The order in which the 'a's and
least one 'a' or 'd', and finally an 'r'. The series of 'a's and 'd's in each function's name is chosen to
Perform compositions of car and cdr operations. Their names consist of a 'c', followed by at
def accessor(sequence)
  sequence.reverse.each_char.reduce(self) do |memo, char|
    case char
    when "a" then memo.head
    when "d" then memo.tail
    end
  end
end