# File multiset/libmultiset.rb, line 718
  def to_s(delim = "\n")
    buf = ''
    init = true
    self.each_pair do |item, count|
      if init
        init = false
      else
        buf += delim
      end
      item_tmp = block_given? ? yield(item) : item.inspect
      buf += "\##{count} #{item_tmp}"
    end
    buf
  end