Those who don't have/prefer the front end of Mathematica will either use a plain ASCII editor to write a script in an .m
file or just use Mathematica directly from a command-line terminal. In either case, everything must be supplied in InputForm
.
When working with a Mathematica package, commonly used symbols/functions might be excessively verbose in InputForm
, and certain shortcuts/aliases would be greatly desired. Examples of built-in InputForm
shortcuts are the infix operators +
(Plus
), -
(Minus
), ... and .
(Dot
).
Two questions that arise as a package developer:
Can I make definitions to
InputForm
? That is, can I modify how input supplied asInputForm
gets parsed intoFullForm
?
Example 1
<
...>
should correspond to AngleBracket
. That is, <a,b,c>
should correspond to AngleBracket[a,b,c]
.
Example 2
Remap character .
to package function myDot
:
a.b.c
should be no longer be parsed inInputForm
asDot[a,b,c]
- It should be parsed
myDot[a,b,c]
.
(n.b. the solution for the analogous question in StandardForm
assuming a front end is here.)