def partition(&block)
      raise Erlang::ImproperListError if improper?
      return enum_for(:partition) if not block_given?
      left = left_tail = Erlang::Cons.allocate
      right = right_tail = Erlang::Cons.allocate
      list = self
      while !list.empty?
        if yield(list.head)
          new_node = Erlang::Cons.allocate
          new_node.instance_variable_set(:@head, list.head)
          new_node.instance_variable_set(:@improper, false)
          left_tail.instance_variable_set(:@tail, new_node)
          left_tail.instance_variable_set(:@improper, false)
          left_tail.immutable!
          left_tail = new_node
          list = list.tail
        else
          new_node = Erlang::Cons.allocate
          new_node.instance_variable_set(:@head, list.head)
          new_node.instance_variable_set(:@improper, false)
          right_tail.instance_variable_set(:@tail, new_node)
          right_tail.instance_variable_set(:@improper, false)
          right_tail.immutable!
          right_tail = new_node
          list = list.tail
        end
      end
      if not left_tail.immutable?
        left_tail.instance_variable_set(:@tail, Erlang::Nil)
        left_tail.immutable!
      end
      if not right_tail.immutable?
        right_tail.instance_variable_set(:@tail, Erlang::Nil)
        right_tail.immutable!
      end
      return Erlang::Tuple[left.tail, right.tail]
    end
def partition(&block)
      raise Erlang::ImproperListError if improper?
      return enum_for(:partition) if not block_given?
      left = left_tail = Erlang::Cons.allocate
      right = right_tail = Erlang::Cons.allocate
      list = self
      while !list.empty?
        if yield(list.head)
          new_node = Erlang::Cons.allocate
          new_node.instance_variable_set(:@head, list.head)
          new_node.instance_variable_set(:@improper, false)
          left_tail.instance_variable_set(:@tail, new_node)
          left_tail.instance_variable_set(:@improper, false)
          left_tail.immutable!
          left_tail = new_node
          list = list.tail
        else
          new_node = Erlang::Cons.allocate
          new_node.instance_variable_set(:@head, list.head)
          new_node.instance_variable_set(:@improper, false)
          right_tail.instance_variable_set(:@tail, new_node)
          right_tail.instance_variable_set(:@improper, false)
          right_tail.immutable!
          right_tail = new_node
          list = list.tail
        end
      end
      if not left_tail.immutable?
        left_tail.instance_variable_set(:@tail, Erlang::Nil)
        left_tail.immutable!
      end
      if not right_tail.immutable?
        right_tail.instance_variable_set(:@tail, Erlang::Nil)
        right_tail.immutable!
      end
      return Erlang::Tuple[left.tail, right.tail]
    end
Return two `List`s, the first containing all the elements for which the
 block evaluates to true, the second containing the rest.

 @example
   Erlang::List[1, 2, 3, 4, 5, 6].partition { |x| x.even? }
   # => Erlang::Tuple[Erlang::List[2, 4, 6], Erlang::List[1, 3, 5]]

 @return [Tuple]
 @yield [item] Once for each item.