This is a catch-all document for content that should be incorporated somewhere but for one reason or another has not yet found the right place.
- Homeless Contents
Documentation, examples, test suites¶
Mathematica behaviors / quirks¶
Different behavior between the kernel and the notebook¶
The kernel and frontend have different parsers. The differences between them are usually semantically equivalent, but that is not always the case. This section collections meaningful differences between the two. See also Operator Precedence, which lists differences in operator precedence specifically.
Notebook: The expression
x_.. is a syntax error, because
x_. is first parsed as
[Pattern[x,Blank]], and then
. is encountered as an unexpected character.
.. is recognized as
x_.. is parsed as
Different behavior between
ToExpression vs command line¶
The command line and
ToExpression nearly always give the same output. Here are two examples where
ToExpression does not match the command line.
In:= 2``\:22127 Out= 2
In:= ToExpression["2``\\:" <> "22127"] Out= $Failed
On the command line, the following either emits a UTF-8 character encoding error and crashes or else results in the following (notice the skipped
In:= 2``\[Minus]7 Out= 2
In:= ToExpression["2``\\[" <> "Minus]7"] Out= $Failed
RawEscape is as a letter¶
\[RawEscape] is supposed to be a letter-like character. Note also that
\[RawEscape] is listed as a letter in
UnicodeCharacters.tr. However, the FE has a hard time with it.
MathLink`CallFrontEnd[ FrontEnd`UndocumentedTestFEParserPacket["a\[RawEscape]a", False]]
The FE allows
\[RawEscape] to begin a symbol name but not to end a symbol name. The FE interprets as
\[RawEscape] at the end as implicit multiplication.
The command line does not have this problem, i.e. it treats
\[RawEscape] as a letter without issue.