
module Kernel

  # Like #warn produces the current line number as well.
  #
  #   warn_with_line("You have been warned.")
  #
  # _produces_
  #
  #   3: Warning: You have been warned.
  #
  # Note that this method depends on the output of #caller.
  def warn_with_line(msg="", fulltrace=nil)
    trace = caller(1)
    where = trace[0].sub(/:in.*/,'')
    STDERR.puts "#{where}: Warning: #{msg}"
    STDERR.puts trace.map { |t| "\tfrom #{t}" } if fulltrace
  end

end


#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#

# TODO