Searching { in F1 documentation, one at least gets an item for List. But the same thing is not happening for ,, [ or ]. What are the positions of symbols as such in the Wolfram language's expression hierarchical structure? Do they have Heads?
- 136,707
- 13
- 279
- 740
- 9,783
- 3
- 20
- 41
2 Answers
I believe the documentation-page you are looking for is this here
And for some further reading, you might want to look at The Syntax of the Wolfram Language.
The comma has no such page that I could find. Probably, because it such a core part of the language that you instantly grasp. The comma is used to separate different arguments of functions. Even this {1,2,3} is only short for List[1,2,3] which separates the arguments of List.
From the viewpoint of the syntax, both , and [ are neither expressions nor atoms. They are tokens that cannot stand on their own. For your question, however, this does not really matter because even + or /@ is a token and still, you can lookup the documentation for it.
The word "token" comes from the process of turning an input string into a so called syntax-tree that can then be evaluated. When Mathematica reads your input for evaluation, it starts with your input string chunks it into tokens. You can use the nifty fultzTokenize from this answer to see the effect directly in Mathematica. Let's consider the following input
{1, aa, "str"}
and see how this is turned into a list of tokens
Row[Framed /@ fultzTokenize["{1,aa,\"str\"}"], Spacer[10]]

You see that it is not separated after each character. Rather, it is divided into logical parts that are defined by the syntax of the language and these parts is what we call tokens. Important to notice is that some of the tokens are already valid, atomic expressions:
{Framed[#], SyntaxQ[#]} & /@ fultzTokenize["{1,aa,\"str\"}"]

Mathematica now uses the rules of a parser to turn this list of tokens into an expression. For a Mathematica List, this rule could look like this
listExpr ::= '{' '}' | '{' sequenceExpr '}'
After the parsing, Mathematica has internal representation of your input which is usually called abstract syntax tree or AST
TreeForm[{1, aa, "str"}]

Let me close the circle and come back to the documentation. When you press F1 anywhere inside your code, Mathematica will select the closest token near your cursor. Often, the token is already an atomic expression like a built-in function. For these, the reference page is always available.
Other times, you might be near a token that is not an expression by itself. Consider being near the -> or the <| in the following example
<|a -> 1|>
For some of these tokens, a direct documenation page is available but for others this might not be the case. For your specific cases, Mathematica does not have a reference page like it has for e.g. Plot.
In any case, there are two important parts: (1) which token is selected by Mathematica when you press F1 and (2) can it successfully find a reference page.
- 112,764
- 7
- 263
- 474
-
Yes, neither expressions nor atoms. So could you please say something more about tokens? – Αλέξανδρος Ζεγγ Jul 10 '18 at 06:08
-
If you are new to Mathematica, you may want to look at the following:
What are the most common pitfalls awaiting new users?
Where can I find examples of good Mathematica programming practice?
Extremely useful on the most common errors, misunderstandings and peculiarities of Mathematica,
Best
- 325
- 1
- 9
-
2That's quite broad considering the specific question from OP. Could you narrow it, quote relevant parts that answer the question? – Kuba Jul 09 '18 at 12:56
[ ] ,are fundamental parts of WL syntax, covered in any introduction – Kuba Jul 09 '18 at 09:48[and]are briefly mentioned intutorial/GettingUsedToMathematica. (I found this by browsing the virtual book from beginning. ) But I fail to find introduction of,. – xzczd Jul 09 '18 at 11:03( ),[ ],{ }, or[[ ]]enterbrackets, highlight, and pressF1. Click onThe Four Kinds of Bracketing in the Wolfram Language. For;seeCompoundExpressionorSequences of Operations. For,seeList. – Bob Hanlon Jul 09 '18 at 13:42[,]symbol/token explanation. However, for,there is still no direct description, if not mistaken by me. – Αλέξανδρος Ζεγγ Jul 10 '18 at 06:07,I gave the link to the documentation forListwhich shows,as the separator for elements in aList. – Bob Hanlon Jul 10 '18 at 14:53