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

allow characters for lte and gte in a few contexts #1099

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Alex-Jordan
Copy link
Contributor

This is so a student can directly enter ≤ and ≥ in contexts where <= and >= are valid operators.

It affects a bit more than just the two files here, because at least one context (Inequality-SetBuilder) is built on top of contextInequalities.pl.

string => ' <= ',
TeX => '\le ',
kind => "le",
alternatives => [ '=<', "\x{2264}" ],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused by the alternatives, as the first one is the same as the actual operator at line 10. Was this meant to go in the previous operator <=?

One could make =< an alias for => rather than an alternative. I think that might not have been available for operators when this was written.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, I'm looking at this again and I think it is right. Maybe the diff is misleading.

This removes =< as an operator altogether. And then it makes =< and "\x{2264}" be alternatives for <=. Because the original block for <= and =< are right next to each other and nearly identical, the diff that is displayed might be misleading.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My fault, I misread the diffs (argh!).

Note, however, that making =< and >= alternatives means they will not be defined by default (as parseAlternatives is false by default. So that changes the definition of the setup for this context. That is why I was suggesting making =< and >= be aliases rather than alternatives, but if you want them removed, you should make that explicit, and in that case you need to change the documentation as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I didn't think about how alternatives are not available by default. I was thinking I was just simplifying the code, but of course you are right that it would change behavior. I updated the commit to only add the ≤ and ≥ alternatives. (And ≠ in the other file where != has meaning.)

TeX => '\ge ',
kind => 'ge',
reverse => 'le',
alternatives => [ '=>', "\x{2265}" ],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly here.

@Alex-Jordan
Copy link
Contributor Author

Yeah, sorry. I was manually copy-pasting from where I have this in my production server and messed that up. I'll fix it soon.

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.

2 participants