def span(&block)
      raise Erlang::ImproperListError if improper?
      return [self, EmptyList].freeze unless block_given?
      left = left_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
          break
        end
      end
      if not left_tail.immutable?
        left_tail.instance_variable_set(:@tail, Erlang::Nil)
        left_tail.immutable!
      end
      return Erlang::Tuple[left.tail, list]
    end
def span(&block)
      raise Erlang::ImproperListError if improper?
      return [self, EmptyList].freeze unless block_given?
      left = left_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
          break
        end
      end
      if not left_tail.immutable?
        left_tail.instance_variable_set(:@tail, Erlang::Nil)
        left_tail.immutable!
      end
      return Erlang::Tuple[left.tail, list]
    end
Return two `List`s, one up to (but not including) the first item for which the
 block returns `nil` or `false`, and another of all the remaining items.

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

 @return [Tuple]
 @yield [item]