Skip to content

Conversation

@mmatera
Copy link
Contributor

@mmatera mmatera commented Jan 21, 2026

This PR adds the Box form FormBox, which is used to tag a formatted expression with the Form used to format it.

This PR does the largest step so far in making the formatting process in
Mathics compatible with the one in WMA.
The main change is in the sequence of formatting. Now, `MakeBoxes` rules
are not `Downvalues`, of the `MakeBoxes` symbol, but are stored as
`FormatValues` of the corresponding symbols. Rules in `MakeBoxes` are
now restricted to call the `format_element` function, and return a Box
expression that represents its input. Hence, in loading definitions,
`MakeBoxes` is not a special symbol anymore.
Also, the default implementation for formatting basic elements like
symbols, expressions, and lists does not pass through the evaluation
process until explicit rules are set by the user.
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.

2 participants