class Rake::LinkedList

structures in Rake.
Polylithic linked list structure used to implement several data

def self.cons(head, tail)

Cons a new head onto the tail list.
def self.cons(head, tail)
  new(head, tail)
end

def self.empty

The standard empty list class for the given LinkedList class.
def self.empty
  self::EMPTY
end

def self.make(*args)

polymorphic
Make a list out of the given arguments. This method is
def self.make(*args)
  # return an EmptyLinkedList if there are no arguments
  return empty if !args || args.empty?
  # build a LinkedList by starting at the tail and iterating
  # through each argument
  # inject takes an EmptyLinkedList to start
  args.reverse.inject(empty) do |list, item|
    list = cons(item, list)
    list # return the newly created list for each item in the block
  end
end

def ==(other)

Lists are structurally equivalent.
def ==(other)
  current = self
  while !current.empty? && !other.empty?
    return false if current.head != other.head
    current = current.tail
    other = other.tail
  end
  current.empty? && other.empty?
end

def conj(item)

type of head node will be the same list type as the tail.
Polymorphically add a new element to the head of a list. The
def conj(item)
  self.class.cons(item, self)
end

def each

For each item in the list.
def each
  current = self
  while !current.empty?
    yield(current.head)
    current = current.tail
  end
  self
end

def empty?

You should consider overriding this method if you implement your own .make method
object not empty by default
.make guards against a list being empty making any instantiated LinkedList
Is the list empty?
def empty?
  false
end

def initialize(head, tail=EMPTY)

def initialize(head, tail=EMPTY)
  @head = head
  @tail = tail
end

def inspect

Same as +to_s+, but with inspected items.
def inspect
  items = map(&:inspect).join(", ")
  "LL(#{items})"
end

def to_s

Convert to string: LL(item, item...)
def to_s
  items = map(&:to_s).join(", ")
  "LL(#{items})"
end