Is there a list of all symbols with special display forms but no built-in meaning? That is, operators that are described in the tutorial Operators without Built-in Meanings?
2 Answers
Updated to include both unary and binary operators
One idea is to use the usage message of a symbol as a clue that it has a special display form, probably with no built-in meaning. For example:
?TildeTilde
The following 2 functions check the usage message of a symbol to see if it contains "displays as" or "formats as", and then weeds out those symbols where the display boxes of the unary or binary operator indicates that it is a built-in symbol.
binaryQ[str_] := Module[
{usage=ToExpression[str, InputForm, Function[x, MessageName[x, "usage"], HoldAll]]},
If[!StringQ[usage]||StringFreeQ[usage,"displays as" | "formats as"], Return[False]];
With[{sym=Symbol[str]},
str =!= "EmbeddedHTML" &&
FreeQ[
MakeBoxes[sym[a,b]],
PaneSelectorBox|TagBox|str|DynamicBox|PaneBox|PanelBox|InterpretationBox|DynamicWrapperBox
]
]
]
unaryQ[str_] := Module[
{usage=ToExpression[str, InputForm, Function[x, MessageName[x, "usage"], HoldAll]]},
If[!StringQ[usage]||StringFreeQ[usage,"displays as" | "formats as"],Return[False]];
With[{sym=Symbol[str]},
str=!="Defer" &&
FreeQ[
MakeBoxes[sym[a]],
StyleBox|PaneSelectorBox|TagBox|str|DynamicBox|PaneBox|PanelBox
]
]
]
Here is the list of symbols created using the above predicate:
unaryOps = Cases[Names["*"], s_?unaryQ]
{"AngleBracket", "BracketingBar", "CapitalDifferentialD", "CircleTimes", "Coproduct", "Del", "DifferentialD", "DoubleBracketingBar", "MinusPlus", "PlusMinus", "Square", "SubMinus", "SubPlus", "SubStar", "SuperDagger", "SuperMinus", "SuperPlus", "SuperStar"}
binaryOps = Cases[Names["*"], s_?binaryQ]
{"AngleBracket", "Backslash", "Because", "BracketingBar", "Cap", "CenterDot", "CircleDot", "CircleMinus", "CirclePlus", "CircleTimes", "Colon", "Congruent", "Coproduct", "Cup", "CupCap", "Diamond", "DotEqual", "DoubleBracketingBar", "DoubleDownArrow", "DoubleLeftArrow", "DoubleLeftRightArrow", "DoubleLeftTee", "DoubleLongLeftArrow", "DoubleLongLeftRightArrow", "DoubleLongRightArrow", "DoubleRightArrow", "DoubleRightTee", "DoubleUpArrow", "DoubleUpDownArrow", "DoubleVerticalBar", "DownArrow", "DownArrowBar", "DownArrowUpArrow", "DownLeftRightVector", "DownLeftTeeVector", "DownLeftVector", "DownLeftVectorBar", "DownRightTeeVector", "DownRightVector", "DownRightVectorBar", "DownTee", "DownTeeArrow", "EqualTilde", "Equilibrium", "GreaterEqualLess", "GreaterFullEqual", "GreaterGreater", "GreaterLess", "GreaterTilde", "HumpDownHump", "HumpEqual", "LeftArrow", "LeftArrowBar", "LeftArrowRightArrow", "LeftDownTeeVector", "LeftDownVector", "LeftDownVectorBar", "LeftRightArrow", "LeftRightVector", "LeftTee", "LeftTeeArrow", "LeftTeeVector", "LeftTriangle", "LeftTriangleBar", "LeftTriangleEqual", "LeftUpDownVector", "LeftUpTeeVector", "LeftUpVector", "LeftUpVectorBar", "LeftVector", "LeftVectorBar", "LessEqualGreater", "LessFullEqual", "LessGreater", "LessLess", "LessTilde", "LongLeftArrow", "LongLeftRightArrow", "LongRightArrow", "LowerLeftArrow", "LowerRightArrow", "MinusPlus", "NestedGreaterGreater", "NestedLessLess", "NotCongruent", "NotCupCap", "NotDoubleVerticalBar", "NotEqualTilde", "NotExists", "NotGreater", "NotGreaterEqual", "NotGreaterFullEqual", "NotGreaterGreater", "NotGreaterLess", "NotGreaterSlantEqual", "NotGreaterTilde", "NotHumpDownHump", "NotHumpEqual", "NotLeftTriangle", "NotLeftTriangleBar", "NotLeftTriangleEqual", "NotLess", "NotLessEqual", "NotLessFullEqual", "NotLessGreater", "NotLessLess", "NotLessSlantEqual", "NotLessTilde", "NotNestedGreaterGreater", "NotNestedLessLess", "NotPrecedes", "NotPrecedesEqual", "NotPrecedesSlantEqual", "NotPrecedesTilde", "NotReverseElement", "NotRightTriangle", "NotRightTriangleBar", "NotRightTriangleEqual", "NotSquareSubset", "NotSquareSubsetEqual", "NotSquareSuperset", "NotSquareSupersetEqual", "NotSubset", "NotSubsetEqual", "NotSucceeds", "NotSucceedsEqual", "NotSucceedsSlantEqual", "NotSucceedsTilde", "NotSuperset", "NotSupersetEqual", "NotTilde", "NotTildeEqual", "NotTildeFullEqual", "NotTildeTilde", "NotVerticalBar", "Overscript", "PlusMinus", "Precedes", "PrecedesEqual", "PrecedesSlantEqual", "PrecedesTilde", "Proportion", "Proportional", "ReverseElement", "ReverseEquilibrium", "ReverseUpEquilibrium", "RightArrow", "RightArrowBar", "RightArrowLeftArrow", "RightDownTeeVector", "RightDownVector", "RightDownVectorBar", "RightTee", "RightTeeArrow", "RightTeeVector", "RightTriangle", "RightTriangleBar", "RightTriangleEqual", "RightUpDownVector", "RightUpTeeVector", "RightUpVector", "RightUpVectorBar", "RightVector", "RightVectorBar", "ShortDownArrow", "ShortLeftArrow", "ShortRightArrow", "ShortUpArrow", "SmallCircle", "SquareIntersection", "SquareSubset", "SquareSubsetEqual", "SquareSuperset", "SquareSupersetEqual", "SquareUnion", "Star", "Subscript", "Subset", "SubsetEqual", "Succeeds", "SucceedsEqual", "SucceedsSlantEqual", "SucceedsTilde", "SuchThat", "Superset", "SupersetEqual", "Therefore", "Tilde", "TildeEqual", "TildeFullEqual", "TildeTilde", "Underscript", "UnionPlus", "UpArrow", "UpArrowBar", "UpArrowDownArrow", "UpDownArrow", "UpEquilibrium", "UpperLeftArrow", "UpperRightArrow", "UpTee", "UpTeeArrow", "Vee", "VerticalBar", "VerticalSeparator", "VerticalTilde", "Wedge"}
And, here is a table showing the display forms of the symbols:
Replace[
unaryOps,
s_String :> Tooltip[Symbol[s][a], s],
{1}
] //Multicolumn[#, 5, Dividers->All]&
Replace[
binaryOps,
s_String :> Tooltip[Symbol[s][a,b],s],
{1}
] //Multicolumn[#,10,Dividers->All]&
As @Mr. Wizard shows in his answer, there are other undocumented symbols that have special formatting.
-
$\begingroup$ looks like a syntax error no first argument to
Function
and you use a slot symbol with no&
? $\endgroup$ May 31, 2017 at 19:25 -
$\begingroup$ @george2079 It's not a syntax error, but it does look a bit odd.
Function[, f[#]]
is equivalent tof[#]&
, you can use eitherFunction
or&
but not both. I wanted to use the 3-arg version ofFunction
to prevent an evaluation leak. PerhapsFunction[Null, MessageName[#, "usage"], HoldAll]
would have looked better. $\endgroup$ May 31, 2017 at 19:32 -
$\begingroup$ oh I see. I thought it was not working but its just because processing all of
Names["*"]
takes a while. $\endgroup$ May 31, 2017 at 19:43 -
-
$\begingroup$ Carl, is this list expected to be exhaustive? Do all such operators have a usage message? $\endgroup$ May 31, 2017 at 21:03
Here is an approach based on reading the Front End resource UnicodeCharacters.tr
.
This method finds some operators that do not presently appear in Carl Woll's list including documented operators CapitalDifferentialD
, DifferentialD
, and Square
, and runs much more quickly. However it also misses the bracketing operators i.e. AngleBracket
, BracketingBar
, DoubleBracketingBar
.
ucharTR = ReadList[System`Dump`unicodeCharactersTR, Word, RecordLists -> True];
operators =
Cases[ucharTR, {_, ch_, ___, "Infix" | "Prefix" | "Postfix"(*|"InfixOpen"|"Open"|
"Close"*), ___} :> StringTake[ch, {3, -2}]] /. "" -> Sequence[];
free =
operators //
Select[
Module[{syms, msg},
syms =
Rest @ Cases[MakeExpression["a\\[" <> # <> "\]b", StandardForm],
Except[HoldPattern[a | b | Times | Plus], _Symbol], {-1}, Heads -> True];
msg = Quiet[MessageName[#, "usage"] & @@ syms];
syms =!= {} && (! StringQ[msg] || StringContainsQ[msg, " displays as "])
] &
];
Extra operators my method finds:
Complement[free, undefined]
{"CapitalDifferentialD", "DifferentialD", "ExpectationE", "InvisiblePostfixScriptBase", "InvisiblePrefixScriptBase", "Perpendicular", "ProbabilityPr", "RoundImplies", "Square"}
Operators my method misses:
Complement[undefined, free]
{"AngleBracket", "BracketingBar", "DoubleBracketingBar"}
-
$\begingroup$ "CapitalDifferentialD", "DifferentialD", "ExpectationE", "ProbabilityPR", "InvisiblePostfixScriptBase", "InvisiblePrefixScriptBase" and "Square" are all unary operators, and I purposely excluded them (I was interested in binary operators, even though I didn't specify that in my OP). "RoundImplies" seems to have a spurious
MakeBoxes
rule that disables formatting. "Perpendicular" does have a display form. Note that "ExpectationE", "ProbabilityPR", "RoundImplies", "InvisiblePostfixScriptBase", "InvisiblePrefixScriptBase" and "Perpendicular" are undocumented, so probably shouldn't use them. $\endgroup$ May 31, 2017 at 23:03
System`
context a fundamental limitation? $\endgroup$