You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am new to mathics. When reading the document of how to extend mathics, I found the description of usage of Builtin and Predefined maybe incorrect.
In chapter of evaluation.rst, it says
Functions which take no parameters are generally subclassed off of the Builtin class.
However when a function takes parameters it method’s Object class is derived either directly indirectly from the Predefined class rather than the Builtin. To figure out which apply method in the class object to call, each method’s document string (or docstring) is consulted. The lookup process is kicked off using the evaluate() method found in the Predefined class.
And when I contiue to read the document of Hello, World! – using Predefined and Introducing the Builtin Class also with the source code of Builtin and Predefined class, I found the description above is quite opposite.
@CallmeNezha, you are right: Predefineds are Builtins that represent the behaviour and rules or Symbols like True or Pi. So, Predefined objects does not have leaves. Also, there are Expressions which to not take parameters like ``MemoryInUse[]```. Those are represented by Builtins. So, the right sentence would be something like
"Functions which take no parameters are generally subclassed off of the Builtin class, while Symbols are subclassed off of the Predefined class. "
Over the weekend I will try to rewrite this section.
If you can, please look that over to see if this now helps and matches your expectation. @mmatera has the most experience with all of this, so we'll just wait for him to look over before I commit this to the master branch and update the readthedocs material online.
Hi, I am new to mathics. When reading the document of how to extend mathics, I found the description of usage of
Builtin
andPredefined
maybe incorrect.In chapter of evaluation.rst, it says
And when I contiue to read the document of
Hello, World! – using Predefined
andIntroducing the Builtin Class
also with the source code ofBuiltin
andPredefined
class, I found the description above is quite opposite.https://github.com/Mathics3/mathics-development-guide/blob/6b5e3c92089eeed69528ba005afe04e5a4ae94d0/docs/extending/developing-code/code-overview/evaluation.rst
The text was updated successfully, but these errors were encountered: