Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4344522
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:54:34+00:00 2026-05-21T11:54:34+00:00

I would like to define a new operator of the form x /==> y

  • 0

I would like to define a new operator of the form x /==> y, where
the operator /==> is treated as e.g. the /@ operator of Map, and
is translated to MyFunction[x, y]. There is one important aspect: I
want the resulting operator to behave in the frontend like any two-bit
operator does, that is, the two characters (a Divide and a
DoubleLongRightArrow) should be connected together, no syntax
coloration should appear, and they are to be selected together when
clicked, so precedence must be set. Also, I’d rather avoid using the
Notation` package. As a result, I’d like to see something like this:

In[11]:= FullForm[x/\[DoubleLongRightArrow]y]

Out[11]//FullForm= MyFunction[x,y]

Does anyone have an idea how to achieve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T11:54:35+00:00Added an answer on May 21, 2026 at 11:54 am

    Thanks to Mr.Wizard’s links, I’ve found the only example in the documentation on how to parse new operators (the gplus example in Low-Level Input). According to this example, here is my version for the new operator PerArrow. Please comment/critize on the code below:

    In[1]:= PerArrow /: MakeBoxes[PerArrow[x_, y_], StandardForm] := 
      RowBox[{MakeBoxes[x, StandardForm], 
        RowBox[{AdjustmentBox["/", BoxMargins -> -.2], 
          AdjustmentBox["\[DoubleLongRightArrow]", BoxMargins -> -.1]}], 
        MakeBoxes[y, StandardForm]}];
    
    MakeExpression[
       RowBox[{x_, "/", RowBox[{"\[DoubleLongRightArrow]", y_}]}], 
       StandardForm] := 
      MakeExpression[RowBox[{"PerArrow", "[", x, ",", y, "]"}], 
       StandardForm];
    
    In[3]:= PerArrow[x, y]
    
    Out[3]= x /\[DoubleLongRightArrow] y
    
    In[4]:= x /\[DoubleLongRightArrow]y
    
    Out[4]= x /\[DoubleLongRightArrow] y
    
    In[5]:= FullForm[x /\[DoubleLongRightArrow]y]
    
    Out[5]//FullForm= \!\(\*
    TagBox[
    StyleBox[
    RowBox[{"PerArrow", "[", 
    RowBox[{"x", ",", "y"}], "]"}],
    ShowSpecialCharacters->False,
    ShowStringCharacters->True,
    NumberMarks->True],
    FullForm]\)
    

    For sake of clarity, here is a screenshot as well:
    new operator

    Since the operator is not fully integrated, further concerns are:

    • the operator is selected weird when clicked (DoubleLongRightArrow with y instead of with /).
    • accordingly, the parsing part requires the DoubleLongRightArrow to be RowBox-ed with y, otherwise it yields syntax error
    • syntax coloration (at In[4] and In[5])
    • it prints weird if inputted directly (notice the large gaps at In[4] and In[5])

    Now, I can live with these, though it would be nice to have some means to iron out all the minor issues. I guess all these boil down to basically some even lower-level syntax handler, which does not now how to group the new operator. Any idea on how to tackle these? I understand that Cell has a multitude of options which might come handy (like CellEvaluationFunction, ShowAutoStyles and InputAutoReplacements) though I’m again clueless here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to define the following in Javascript: var tileXml = new Array();
I would like to define some kind of safe division (and modulo) function, one
I would like to replace the global operator new() and operator delete() (along with
I would like to define a key & value in Settings.settings and bind the
I would like to define an ordered list with unordered sub-lists. You can see
I would like to define a constant (like the admin-email-adress) depending on the environment.
I would like to define and initialize some variables in web.xml and the access
I would like to define the z order of the views of a RelativeLayout
I would like to define access right to Collabnet Subversion Directory with LDAP domain
I would like to define a function that will be invoked from entry_32.S. It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.