Skip to content

Add an Mathics3 Atom for an Association #1868

Open
rocky wants to merge 16 commits into
masterfrom
add-Association-atom
Open

Add an Mathics3 Atom for an Association #1868
rocky wants to merge 16 commits into
masterfrom
add-Association-atom

Conversation

@rocky

@rocky rocky commented Jul 23, 2026

Copy link
Copy Markdown
Member

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 eval code has been moved from mathics.builtin to mathics.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.

@rocky
rocky requested a review from mmatera July 23, 2026 15:00
@rocky rocky changed the title Add association atom Add an Mathics3 Atom for an Association Jul 23, 2026
@rocky
rocky force-pushed the add-Association-atom branch from 1ae602f to e207cb1 Compare July 23, 2026 16:28
@rocky
rocky force-pushed the add-Association-atom branch from e207cb1 to 8d6770d Compare July 23, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant