Question: How do I refer to the symbol name passed as argument to a procedure?

Hi experts

 

In a procedure with no declared parameteres I would like to return (print) the passed arguments (expecting Matrix structures) in a modified form along with the name of the symbol holding the structure passed as arguments.

 

That is, the procedure just iterates through the _passed arguments in a for-loop to display the name of the the passed argument (the symbol), a colon and then the modified matrix structure.

My problem is that when looping from i to _npassed arguments, refering to _passed[i] gives me the evaluated form.Tat is what I need to modify the structure but not to list the symbol name.

 

Say I wanted to print a transposed version of my passed matrices. Then I would call

M:=<<1,2>|<3,4>>;

myProc(M);

And the result I want would be

M: <<1,3>|<2,4>>

But I don't know if _passed holds the symbol names or just the evaluated versions of the passed arguments??

And theoretically the passed argument (assuming a matrix) could be the matrix structure put directly in the procedure call, in which case there is no symbol to refer to.

 

I hope you get my question and can help me out.

 

Thanks

Simon

 

Please Wait...