5
$\begingroup$

The Cell expression for:

<> 

is

Cell[BoxData["<>"], "Input"] 

However similar expressions are parsed into RowBox(s), for example:

>< Cell[BoxData[RowBox[{">", "<"}]], "Input"] 

How do I get expressions like >< to act like <> does?

$\endgroup$
3
  • 1
    $\begingroup$ My bet is you can't. Operators are predefined and I definately hope someone proves me wrong $\endgroup$ Commented Aug 23, 2012 at 23:26
  • $\begingroup$ You could probably put something together with InterpretationBox and MakeBoxes $\endgroup$ Commented Aug 23, 2012 at 23:37
  • $\begingroup$ @R.M I will look into it last time I tried to use InterpretationBox I ran into a dead end. $\endgroup$ Commented Aug 23, 2012 at 23:51

2 Answers 2

3
$\begingroup$

Michael Pilat has stated that you cannot create your own compound operators.

You may find some utility in these posts:

Prefix operator with low precedence

How can one define an infix operator with an arbitrary unicode character?

$\endgroup$
2
  • $\begingroup$ Shouldn't it be closed as a duplicate then? $\endgroup$ Commented Aug 24, 2012 at 2:53
  • $\begingroup$ @R.M which one where? $\endgroup$ Commented Aug 24, 2012 at 7:12
2
$\begingroup$

Are you interested only in the case of "less than" and "greater than" symbols? Might other variations serve the purpose?

The following parentheses are represented like "<>" (they are represented without using RowBox), regardless of the order of the characters:

parentheses

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.