Fixes that makes CellsToTeX finally loads #624
Draft
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.
One old (small) goal that I had was to fix enough Mathics in order that some relatively non-trivial packages be loaded without failing in basic stuff like storing their definitions.
With this bunch of fixes, I was able to load CellsToTeX` (https://github.com/jkuczm/MathematicaCellsToTeX) and call some of its functions without a crash. Of course, to really make it work I would need to implement several builtins specific for handling WMA notebooks, but I think this is this is a step forward.
I am going to put this as a draft PR and then split back the parts.
#.
get_sort_key
now has a uniform interface on all the subclasses ofKeyComparable
, accepting the parameterpattern_sort
.#. circular dependencies in
mathics.core.definitions
were reduced.#.
to_boxes
now returns always aFullForm
of the input Expression, instead of raising an exception.#. Rules of the form
pat->Condition[expr, cond]
are handled as in WL. The same works for nestedCondition
expressions. Also, comparisons among these objects were improved.