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

Minor things noticed in looking over the code #1087

Closed rocky closed 2 months ago

rocky commented 2 months ago

Here are some minor things noticed in looking over this module.

There is something that greatly bothers me that isn't fixed though.

In this module, the base class is named Pattern. Elsewhere, base classes are prefaced with Base. For example, BaseElement, BaseRule, or BaseForm.

And then, because of this, the builtin function Pattern[] in module mathics.builtin.pattern uses the class name Pattern_.

To me, all of this feels like a gratuitous complication (even though I imagine this was due to sloppiness).

mmatera commented 2 months ago

Here are some minor things noticed in looking over this module.

There is something that greatly bothers me that isn't fixed though.

In this module, the base class is named Pattern. Elsewhere, base classes are prefaced with Base. For example, BaseElement, BaseRule, or BaseForm.

And then, because of this, the builtin function Pattern[] in module mathics.builtin.pattern uses the class name Pattern_.

To me, all of this feels like a gratuitous complication (even though I imagine this was due to sloppiness).

I fully agree. If you are up for it, please include the changes here.

rocky commented 2 months ago

I fully agree. If you are up for it, please include the changes here.

Done. I suspect down the line we will want to make even more changes to the code touched here, but this is just another step in the right direction of making the code more easily understandable.