Re: print variable name and its value
- To: mathgroup at smc.vnet.net
- Subject: [mg99998] Re: print variable name and its value
- From: "Marc B. Reynolds" <marc.reynolds at orange.fr>
- Date: Thu, 21 May 2009 00:08:03 -0400 (EDT)
Something like this works:
DumpVar[x_] := Print[ToString[HoldForm[x]], ":", x];
SetAttributes[DumpVar, {Listable, HoldAll}]
x:=1;
y=2;
DumpVar[x];
DumpVar[y];
DumpVar[{x,y}];