Example question: I look for all the symbols with a pattern: foundVars=Names["var*"]. I want to get all their Own, Down, and Up values and save them. I can do this with Save but that’s not quite my question. I can’t do this: DownValues/@foundVars
Example Question 2: I create a function to check symbol naming:
in: var3=.; (*Clear var3*)
in: checkName[var3]
out: True (*so far so good*)
in: var3 = 2; (*give var3 a value*)
in: checkName[var3]
out: SymbolName: Argument 2 at position 1 is expected to be a symbol
Looking at the results from DownValues, OwnValues, etc. I’m guessing the trick has something to do with HoldPattern, but I haven’t been able to piece it together. Let me know some tricks and best practices when working with symbols.
Thank you Illian, that gives me some hints. I’ve never used the third argument of ToExpression and haven’t been able to use Unevaluated effectively. Great suggestions!