def delete_at(index)
      raise Erlang::ImproperListError if improper?
      if index == 0
        tail
      elsif index < 0
        index += size if index < 0
        return self if index < 0
        delete_at(index)
      else
        out = tail = Erlang::Cons.allocate
        list = self
        while index > 0
          new_node = Erlang::Cons.allocate
          new_node.instance_variable_set(:@head, list.head)
          new_node.instance_variable_set(:@improper, false)
          tail.instance_variable_set(:@tail, new_node)
          tail.instance_variable_set(:@improper, false)
          tail.immutable!
          tail = new_node
          list = list.tail
          index -= 1
        end
        if not tail.immutable?
          tail.instance_variable_set(:@tail, list.tail)
          tail.immutable!
        end
        return out.tail
      end
    end
def delete_at(index)
      raise Erlang::ImproperListError if improper?
      if index == 0
        tail
      elsif index < 0
        index += size if index < 0
        return self if index < 0
        delete_at(index)
      else
        out = tail = Erlang::Cons.allocate
        list = self
        while index > 0
          new_node = Erlang::Cons.allocate
          new_node.instance_variable_set(:@head, list.head)
          new_node.instance_variable_set(:@improper, false)
          tail.instance_variable_set(:@tail, new_node)
          tail.instance_variable_set(:@improper, false)
          tail.immutable!
          tail = new_node
          list = list.tail
          index -= 1
        end
        if not tail.immutable?
          tail.instance_variable_set(:@tail, list.tail)
          tail.immutable!
        end
        return out.tail
      end
    end
Return a `List` containing the same items, minus the one at `index`.
 If `index` is negative, it counts back from the end of the list.

 @example
   Erlang::List[1, 2, 3].delete_at(1)  # => Erlang::List[1, 3]
   Erlang::List[1, 2, 3].delete_at(-1) # => Erlang::List[1, 2]

 @param index [Integer] The index of the item to remove
 @return [List]