2
$\begingroup$

I'm trying to introduce automatic replacements by modifying my notebook's value of InputAutoReplacements (e.g. via CurrentValue[InputNotebook[], InputAutoReplacements] = {"typedinput" -> "replacement", ...}).

InputAutoReplacements, though, only works for things that are deemed to be tokens by Mathematica.

So, if you introduce the rule "abc" -> "A", abc will be replaced in your input expression by A once Mathematica parses abc as a token (e.g. once you type a space or some other non-symbol-name character after it); but "|->" -> "\[RightTeeArrow]" will not cause a replacement of |->, because it is not recognized as a token.

But what if I wanted to make Mathematica recognize |-> as a token? Is there any way to do that? Or is there a safer workaround? (How does Mathematica actually implement the parsing of its input, anyway?)

$\endgroup$

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.