Mathematica's help on SyntaxInformation does not rule out syntax information for pure functions.
SyntaxInformation[f] gives information used to generate syntax coloring and other advisories when f[…] is entered as input.
The naive code
f = # &;
SyntaxInformation[f] = {"ArgumentsPattern" -> {_}}
fails with a message about the first argument. Using the string instead of the symbol
SyntaxInformation["f"] = {"ArgumentsPattern" -> {_}}
does not throw a message but it does not produce the expected red parameters in f[a,b]
.
Is there any way to specify syntax information on pure functions?
SyntaxInformation
works at theSymbol
level. Call it before assigning tof
. $\endgroup$