From: Richard Lionheart Date: 2004-06-06T21:48:40+09:00 Subject: When arg is a variable, can the variable's name be displayed? Hi, 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 v1 = 'abc' dump(v1) # ==> v1 = "abc" v2 = 123 dump(v2 ) # ==> v2 = "123" I recognize that this simple thing, if it worked for strings and numbers, probably wouldn't work for some more complex types, but I'll worry about that another day :-) And I acknowledge this isn't the world's greatest debugging tool, but it'll help me develop some tool-writing skills in Ruby. TIA, Richard --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.698 / Virus Database: 455 - Release Date: 6/4/2004