global

def xmp(exps, bind = nil)

See XMP.new for more information.

#=> "bar"
ctx.eval 'foo'
#==>"bar"
#=> foo = "bar"
xmp 'foo = "bar"', ctx
ctx = binding
require 'irb/xmp'

For example:

evaluates the given expressions using the +:XMP+ prompt mode.
parameter, and optional binding as +bind+ or uses the top-level binding. Then
Creates a new XMP object, using the given expressions as the +exps+

A convenience method that's only available when the you require the IRB::XMP standard library.
def xmp(exps, bind = nil)
  bind = IRB::Frame.top(1) unless bind
  xmp = XMP.new(bind)
  xmp.puts exps
  xmp
end