> For debugging purposes,  I'd like to write a routine to dump a
variables
> name and value, sort of like Object#inspect but different.  I'd like
to
> write:

> def dumpv(var)
>     $stdin.print var.name + ' = "' + v.to_s + "\"\n"
>     $stdin.flush
> end

Variables are just names, not memory slots. You therefore must pass the
variable name.

irb(main):001:0> def dump(varname, binding)
irb(main):002:1>   puts "#{varname}: #{eval(varname, binding)}"
irb(main):003:1> end
=> nil
irb(main):004:0> a = 1
=> 1
irb(main):005:0> dump 'a', binding
a: 1
=> nil