Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve named character operators #118

Open
kubaPod opened this issue Mar 4, 2019 · 3 comments
Open

Resolve named character operators #118

kubaPod opened this issue Mar 4, 2019 · 3 comments

Comments

@kubaPod
Copy link

kubaPod commented Mar 4, 2019

Currently they are considered part of a symbol name if there is no space. Which usually does not happen because the space is added automatically when pasted.

With exception of e.g. \[Transpose] which is pasted without spaces.

  • Most important: \[Transpose] \[ConjugateTranspose] \[Conjugate]

  • Important: \[UndirectedEdge] \[DirectedEdge] and friends

  • Less important because they are converted to ASCII when pasted: \[Rule], \[LeftDoubleBracket] and friends

related: #117

@szhorvat
Copy link
Contributor

szhorvat commented Mar 4, 2019

\[ConjugateTranspose] and \[Conjugate]?

@kubaPod kubaPod changed the title Resolve Resolve named character operators Mar 4, 2019
@halirutan halirutan added this to the ,.mbkl milestone Mar 17, 2019
@halirutan halirutan removed this from the ,.mbkl milestone Aug 6, 2019
@simonkeys
Copy link

simonkeys commented Apr 9, 2020

My project makes heavy use of \[CenterDot], \[Vee], and \[Wedge]. It would be a huge benefit to me if these were supported!

@halirutan
Copy link
Owner

@simonkeys At the moment and for the foreseeable future, I have to explicitly ban the usage of named character operators. That means, the plugin recognizes them, knows that these named characters are operators (and cannot be part of symbol names), and marks them as unsupported. The solution is to use CenterDot[x, y] instead of x \[CenterDot] y which is (a) shorter and (b) the order of evaluation is absolutely clear. For instance, it's hard to tell in which order

a * b \[CenterDot] c * d

is evaluated if someone reads your code, while a * CenterDot[b,c] * d is clear.

However, the main reason I don't work on this is that as of today the Wolfram Language still has no official language specification (grammar). The front end (what you type in the notebook) and the kernel have differences in interpreting input code. Therefore:

  • It takes an incredible amount of time to manually test and verify the precedences and associativities of all possible ASCII, Unicode, and named character operators. I talk here about months of work, not weeks. For instance, I know that Brenton worked on his code parser that was just released at least since late 2018. And he is working for Wolfram full-time.
  • It requires substantial changes in the core of the plugin so that eventually many parts need to be adapted.
  • People wouldn't like to see a \[CenterDot] b, they want a · b. That has also been a famous request. However, many characters like \[Rule] are only available in Mathematica's fonts. Inside IntelliJ, I will not be able to display many of them correctly.

So right now, the only advantage of supporting named character operators would be that people can write them infix as you want. I hope you understand that the price tag on this feature is too hight right now. I left this issue open so that one day, when we have a clear specification of the Wolfram Language, and I'm not working a full-time job in an entirely different branch, I can come back to it 😁.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants