Subject: get name of variable as string in function?
From: Edwin Woollett
Date: Thu, 2 Feb 2012 13:02:27 -0800
I would like to define mprint(var) such that
mprint(a) would give
a = (value of a)
so far I have tried:
--------------------------------
(%i1) a:2;
(%o1) 2
(%i2) mprint(zz) := print(sconcat(string(zz)," = "),zz)$
(%i3) mprint(a);
2 = 2
(%o3) 2
(%i4) mprint(zz) := print(sconcat(string('zz)," = "),zz)$
(%i5) mprint(a);
zz = 2
(%o5) 2
-------------------
Ted Woollett