-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
Expression constants #831
Expression constants #831
Conversation
I have been wondering if the things here are is a constant expression or a symbolic constant. I am also curious how this fits into other kinds of symbolic constants like Over the weekend I would like to look into this and think about this. However I am interested in your thoughts about this. |
mathics/core/expression_constants.py
Outdated
elements_properties = ElementsProperties(True, True, True) | ||
super().__init__(head, *elements, elements_properties=elements_properties) | ||
|
||
def evaluate(self, evaluation: Evaluation): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there other methods that can be specialized?
So, if we want to stick to the compatibility, we should take
and also,
So, in principle, in WMA, we could redefine |
For completeness, here is another example:
At the beginning,
because
but
So, if we try to apply a rule, and the rule fails, then |
And by doing so in the Python code we get simpler detection and a simpler way for referring to this (new and important) constant symbol. Personally, I think it useful and important in the code to draw attention to and highlight these kinds of protected and locked constants.
Thanks for the information.
Ok. Personally, I want to stick to compatiblity. If
Or just remove the specialization of This does point out though though that the name |
LGTM and thanks! Sorry for the delay. Looking over the discussion and code we could implement |
This comes from #828. Here a new module is added to contain the expression constants of the form
DirectedInfinity[...]
.