Add an Mathics3 Atom for an Association #1868
Open
rocky wants to merge 16 commits into
Open
Conversation
Handle OutputForm of Association atom type.
rocky
force-pushed
the
add-Association-atom
branch
from
July 23, 2026 16:28
1ae602f to
e207cb1
Compare
rocky
force-pushed
the
add-Association-atom
branch
from
July 23, 2026 16:52
e207cb1 to
8d6770d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First cut at converting an Association Expression into a more performant Association Atom.
The Association Atom is an object that wraps a Python dictionary of BaseElements and includes the additional Mathics3 Atom methods typically associated with Atoms.
Since it is based on Python dictionaries, it handles key lookup and update more efficiently.
For now, we still have several eval (complicated and inefficient) functions for an S-Expression-based representation. And that is because there still may be situations where we encounter S-Expression-based Associations.
Over time, this code will probably be revised to avoid this, and in conjunction with that, the additional eval functions will be removed as they become unnecessary.
More
evalcode has been moved frommathics.builtintomathics.eval.Argument checking added to affected Modules.
Several bugs in Association handling were fixed. In particular, the Ordering properties of Associations with respect to other objects like Strings. Some output routines were not displaying as an Association properly.