Mathics3 / mathics-core

An open-source Mathematica. This repository contains the Python modules for WL Built-in functions, variables, core primitives, e.g. Symbol, a parser to create Expressions, and an evaluator to execute them.
https://mathics.org
Other
786 stars 48 forks source link

Start Operators with no meaning section #1171

Closed rocky closed 1 week ago

rocky commented 1 week ago

@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 commented 1 week ago

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

rocky commented 1 week ago

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 commented 1 week ago

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.

mmatera commented 1 week ago

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 commented 1 week ago

@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.

mmatera commented 1 week ago

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