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

Add \bbsemi as a binary operator #34722

Merged
merged 9 commits into from
Feb 20, 2020
Merged

Add \bbsemi as a binary operator #34722

merged 9 commits into from
Feb 20, 2020

Conversation

tkf
Copy link
Member

@tkf tkf commented Feb 10, 2020

; is used as the composition operator in "diagrammatic order" (Category (mathematics) - Wikipedia). Although we can't use the normal semicolon as a binary operator in Julia, we can include (\fatsemi) as a binary operator.

A big thanks to the post by @schlichtanders in Discourse: https://discourse.julialang.org/t/add-composition-operator-unicode-2a1f-for-flipped/34436

@stevengj
Copy link
Member

stevengj commented Feb 11, 2020

What’s the difference between U+2a1f and U+2a3e?

@tkf
Copy link
Member Author

tkf commented Feb 11, 2020

Formal Specification— Z Notation— Syntax, Type and Semantics (http://www.open-std.org/jtc1/sc22/open/n3187.pdf) says

schema composition ‘o9’ and the mathematical toolkit character relational composition ‘o9’ are different Z characters;

(o9 is rendered as o on top of 9 in the PDF)

The motivation discussed in the aforementioned discourse thread was to define f ⨟ g = g ∘ f that is presumably primarily used for functions. So, IIUC, I think relational composition (2A3E) makes more sense (see Table 14). @schlichtanders @jw3126 What do you think?

As two characters are pretty much identical, I think omitting schema composition (2A1F) makes sense. This is compatible with that we don't have, e.g., \setminus ().

Another consideration may be to see if there are fonts that have only one of the characters. But so far I find that it's either both of them are rendered or none of them are rendered (though maybe it's just my editor and terminal are finding fallbacks).

@schlichtanders
Copy link

What’s the difference between U+2a1f and U+2a3e?

From simple inspection of the unicode alternatives at this page https://unicode.org/charts/PDF/U2A00.pdf

I find 2A1F much more appealing visually (compared to its counterpart 2A3E). In addition, also its latex name is lovely self-descriptive \fatsemi

@tkf
Copy link
Member Author

tkf commented Feb 11, 2020

It seems there are multiple ways to enter certain symbols. So I hope it's OK to add both \fatsemi and \bb; (as how it's implemented in the current PR).

julia> length(unique(keys(REPL.REPLCompletions.latex_symbols)))
2495

julia> length(unique(values(REPL.REPLCompletions.latex_symbols)))
2475

Re: 2A3E vs 2A1F, I don't really mind which one is chosen. It looks like 2A1F is rendered as a bigger symbol so maybe it's better for readability.

@tkf tkf changed the title Add \fatsemi as a binary operator Add \fatsemi (\bb;) as a binary operator Feb 11, 2020
@cormullion
Copy link
Contributor

There's a bit of variety in the commonly used fonts:

Z NOTATION SCHEMA COMPOSITION 2A1F
Z NOTATION RELATIONAL COMPOSITION 2A3E

(But a mild vote against "fatsemi" which is far from a "lovely" name... :))

@JeffBezanson
Copy link
Sponsor Member

I think \bbsemi would be more consistent with other latex names than \bb;.

@tkf
Copy link
Member Author

tkf commented Feb 12, 2020

I replaced \bb; with \bbsemi. Since no one seems to be opposing U+2a1f, I also replaced u+2a3e with u+2a1f.

Can this be merged? Is there anything else to be addressed?

@tkf tkf changed the title Add \fatsemi (\bb;) as a binary operator Add \fatsemi (\bbsemi) as a binary operator Feb 12, 2020
@tkf
Copy link
Member Author

tkf commented Feb 12, 2020

I removed \fatsemi.

Note that people want to use this alias can simply do:

julia> using REPL

julia> REPL.REPLCompletions.latex_symbols["\\fatsemi"] = ""

@tkf tkf changed the title Add \fatsemi (\bbsemi) as a binary operator Add \bbsemi as a binary operator Feb 12, 2020
@JeffBezanson JeffBezanson added the triage This should be discussed on a triage call label Feb 14, 2020
@JeffBezanson JeffBezanson merged commit 7e2363b into JuliaLang:master Feb 20, 2020
@JeffBezanson JeffBezanson removed the triage This should be discussed on a triage call label Feb 20, 2020
@tkf tkf deleted the fatsemi branch February 20, 2020 21:50
birm pushed a commit to birm/julia that referenced this pull request Feb 22, 2020
KristofferC pushed a commit that referenced this pull request Apr 11, 2020
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

Successfully merging this pull request may close these issues.

5 participants