I have a list of symbols {sym1,sym2, sym3,...}
I would like to have Mathematica build the list {HoldForm[sym1],HoldForm[sym2],HoldForm[sym3], ...}
The purpose is to build a list for use in Switch. to allow print of the symbol associated with a computed value. How does one prevent Mathematica from evaluating the symbol I want to place in the HoldForm?
So far as I know, the only way to construct HoldForm[symbol] is to manually enter (type) it. Any programmatic use of a symbol is replaced by its evaluation, e.g. if you try to Map HoldForm on a list of symbols you get each evaluation of each symbol, not the symbol names.
All examples are examples of failure.
(Try? Holding a list of symbols holds the list name, not the list members.)
A List is just a function which does not do anything besides being a container (well, sort of). In this way you can define you own “List function” with special properties, e.g.:
Yes thank you, excellent. Just what I wanted - a list of symbols in the same order as the values. Nesting is not necessary. res1 for the values and res3 for the symbols. res2 is an interesting in-between result.