[go: up one dir, main page]

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

/= ligature doesn't work well for Ruby #78

Open
sos4nt opened this issue Oct 21, 2016 · 7 comments
Open

/= ligature doesn't work well for Ruby #78

sos4nt opened this issue Oct 21, 2016 · 7 comments

Comments

@sos4nt
Copy link
sos4nt commented Oct 21, 2016

In Haskell, /= is the not-equal operator, so it seems obvious to map it to

But in Ruby (and presumably other languages, too), != is the not-equal operator and a /= b is a shortcut for a = a / b:

i = 10
i /= 2 #=> 5
i      #=> 5

# vs.

i = 10
i != 2 #=> true
i      #=> 10

Using the current ligature makes the code quite confusing:

i = 10
i  2  # will this alter i or return true?

I'm not sure how to solve it, but maybe there should be a language-agnostic base font and specialized language fonts.

@hauleth
Copy link
hauleth commented Oct 21, 2016

We can use other ligature for /= like Fira Code:

image

It still reassembles intention but is less similar to . Other option would be using other ligature for != but unfortunately /= isn't much popular as compare operator and != is popular one.

@sos4nt
Copy link
Author
sos4nt commented Oct 21, 2016

@hauleth that looks good. I think the font should not attempt to interpret the characters or imply a meaning. It should merely make them look a bit nicer, IMO.

@hauleth
Copy link
hauleth commented Oct 21, 2016

Alternatively any of them should look like . Both could just fix spacing between symbols.

@sos4nt
Copy link
Author
sos4nt commented Oct 21, 2016

Alternatively any of them should look like

Sorry, I don't follow. Do you mean "none of them"?

@am-kantox
Copy link

I agree with @sos4nt that the font should not attempt to interpret the characters or imply a meaning. I personally would be confused to see is ruby code, though I am familiar with both Haskell and ligatures. I just don’t expect a table to magically become a chair when I sit down it.

On the other hand, /= is the division shorthand in many languages, in my opinion, it would be fine to fall back to Fira Code’s approach to preserve the meaning of /= in each language.

Nifty != ligature, just sticking ! and = together would be fine for not equal in ruby-like syntax.

@turbohz
Copy link
turbohz commented Oct 21, 2016

It's obvious that having a single font (with ligatures) for all languages is a problem, and this is yet another example.

The ideal situation is multiple font versions, and IDEs and editors that allow setting font per syntax (language).

@cblp
Copy link
cblp commented Jun 11, 2019

@hauleth But FiraCode cannot be used in Haskell, because they break ligature laws substituting != with , so you may be confused when encounter instead of != in Haskell code.

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

5 participants