I'm not really sure if an answer is appropriate here, and I'm on the verge of voting to close this question. But for now, here are some thought about your three questions/issues:
- I have no idea what a letter-like form really is.
The documentation that you linked to has large lists of letter-like forms. I suggest that you just read through that section. Basically, letter-like forms are free from any special parsing rules, and so get treated as symbols (as does any catenation of them).
- Does it make sense to use objects as variables or should I use only symbols?
This is where things get tricky. This might be a bit much if you're new to Mathematica, but there aren't really variables in the traditional programming sense. What I'm calling the "traditional sense" here is where variables are really just aliases to memory locations. In Mathematica everything is just an expression. Some expressions have rules for how to "compute" or "transform" or "rewrite" them. If I evaluate x = 7
what I am NOT doing is allocating memory for an integer and using x
to reference what's stored there. What I AM doing is saving a rule in the "environment" that says that whenever the evaluator encounters x
it should replace it with 7
. It's abstract and complicated and not really appropriate here, so I'll leave it at that.
So, your question doesn't really make sense. You should use raw symbols or more complicated expressions as needed. There is no rule about that (other than the basic rules of syntax and evaluation that are built in). So, if it makes your situation semantically clear to say x = 7
, then do that. If it would be clearer to say x[1] = 7
, then do that. But either way, you're just creating rewrite rules.
- If I understand correctly, objects with annotated names are in fact unary operators. But I suppose that they are used in a different way.
I'm really not sure how to interpret this one. I think maybe what you mean by "objects with annotated names" is headed expressions. An expression like Sqrt[7]
has Sqrt
as its head. Now, Sqrt
has built-in rules associated to it, and you can think of it as a unary operator, but that's just a model to carry around in your head. To Mathematica, Sqrt[7]
is just an expression.
So, OverHat[x]
is just another expression. Out of the box, it has no built-in rewrite rules associated to it. But you can make your own: OverHat[x] = 7
. As it turns out, this probably isn't a very good thing to do, as there's nothing preventing x
itself from being assigned its own rewrite rules, e.g. x = 17
, in which case the rule OverHat[x] = 7
will be masked so that if you evaluate OverHat[x]
now, you'll get OverHat[17]
.
SymbolName
? $\endgroup$OverHat[x]
? $\endgroup$SymbolName["Overscript[x,^]"]
, then that message makes sense. Any expression of the formSomeSymbol[<...stuff...>]
is a headed expression and so not a symbol by definition (by the basic syntax of Mathematica), soSymbolName
cannot give you the name, because you didn't give it a symbol. $\endgroup$