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

Start Operators with no meaning section #1171

Merged
merged 3 commits into from
Nov 18, 2024
Merged

Start Operators with no meaning section #1171

merged 3 commits into from
Nov 18, 2024

Conversation

rocky
Copy link
Member

@rocky rocky commented Nov 17, 2024

@mmatera Please look this over when you have a chance to see if this "no-meaning" Star operator is done properly.

@axkr says that it would be needed for Rubi.

@mmatera
Copy link
Contributor

mmatera commented Nov 17, 2024

Isn't this symbol already contained in the Mathics script tables?

That is, they can take more than two arguments. The operator
appears in betweek all operands.
@rocky
Copy link
Member Author

rocky commented Nov 17, 2024

Isn't this symbol already contained in the Mathics script tables?

Yes, \[Start] is already available as a Character Symbol. However to use it as an Infix binary operator, right now, we need some operator code.

One day after the operator table in MathicsScanner is completed, we might be able to use the information there and create classes from generic operators. Unfortunately, we aren't close to having that done.

@rocky
Copy link
Member Author

rocky commented Nov 18, 2024

I've been thinking about this some more, and there is probably a way to get closer by having a generic "no-meaning" class, of which "Star" is an instance. And with this, we can probably plug in more of what we currently have on the MathicsScanner operator YML side.

@rocky rocky marked this pull request as draft November 18, 2024 07:43
@mmatera
Copy link
Contributor

mmatera commented Nov 18, 2024

It would be awesome to be able to load all the "operators without a meaning" from mathics-scanner. We could have a "mother class" as we have for NamedColors, and then fill it with the entries inside of Mathics scanner tables that are not associated to already loaded symbols.

@rocky
Copy link
Member Author

rocky commented Nov 18, 2024

@aravindh-krishnamoorthy If you need the Star implemented as an operator for Rubi, this branch can be used. However, I will be reworking the code to be more generic and hook it into a list of operators that do not have any pre-defined meaning. This list of operators will be maintained in MathicsScanner. However, that may take a bit more time. I'll keep this branch as is in the interim.

"""

# Note: grouping must be Python string, not a Symbol.
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be OK if in the class definition, we use a Python string, if we convert it later into a Symbol. So, it would be a problem of contribute

Copy link
Contributor

Choose a reason for hiding this comment

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

I checked it out, and indeed grouping is used to build a Python str, that is parsed as a pattern object for defining formatting and boxing rules. So probably it is OK to keep is as a str.

@mmatera
Copy link
Contributor

mmatera commented Nov 18, 2024

I think we can merge this as it is, adding a comment at the beginning of no_meanin.py explaining how this should grow.

@rocky rocky marked this pull request as ready for review November 18, 2024 22:47
@rocky rocky merged commit bf6a8c0 into master Nov 18, 2024
13 checks passed
@rocky rocky deleted the add-Star branch November 18, 2024 23:29
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