Hi -
I am trying to use "get" inside a function in order to make decisions based on the properties of the variable I've passed to the function. I've used LISP as well as various versions of Macsyma/Maxima in the dim and distant past, but I've just started to use it again recently. I'm using version 5.23.2 of XMaxima in Windows. I am doing the following at the command line :
g_ll:matrix([-1,0,0,0],[0,A^2/(1-K*r^2),0,0],[0,0,A^2*r^2,0],[0,0,0,A^2*r^2*sin(theta)^2]);
put(' g_ll,' Trank2LL,' Trank);
NOTE : I've intentionally put spaces after every ' in this email so that they can be seen (the ' is hard to see as 'T on my screen). My actual code has no spaces.
My function is currently (stripped down for testing, and to match the manual's example) :
TensorTrace (T) :=
block
(
[temp],
temp:get(' T,' Trank)
)$
And the function call is : TensorTrace(g_ll);
My problem is this : WITH a ' before the T (as shown), the debugger says that T is a 4x4 matrix with the correct terms, but T only has the properties [value], whereas (also within the debugger) g_ll has the properties [value, [user properties, Trank]].
And WITHOUT a ' before the T, when I call the function I get a "get: argument must be a symbol or a string; found: errexp1" error message. But the example on (Adobe's) page 514 of the manual under get shows :
get(expr,'type)
where expr is the variable passed to the function!
I'm so confused! Is there some other option besides ' T and T ? Why doesn't it work without a ' like the example in the manual?
Thanks in advance to all who reply.
Bruce Linnell, PhD