Hi, On 1/13/25 3:44 PM, Vladimir V. Kisil wrote:
On Sun, 12 Jan 2025 10:20:43 +0000, "Vladimir V. Kisil" <V.Kisil@leeds.ac.uk> said:
VVK> Yes, Richard, I see your point.
Yet, one printing context, which may also benefit from a lexicographic ordering vs random memory allocation, is LaTeX...
So I've changed the add and mul classes' dflt and latex print context handlers to internally pre-sort the expressions before printing. It is quite nice to see that this loop: for i in $(seq 1 1000); do echo "expand(a*(a+b)*(a+b+c)*(a+b+c+d));" | ginsh; done |sort|uniq produces just one output instead of oodles of lines. On the other hand, changing the ginsh command to "op(expand(a*(a+b)*(a+b+c)*(a+b+c+d)),3);" still prints several lines, which is expected since it is only the output which is sorted in a lexicographical order. All other print contexts are unchanged. I invite people to check out the current code from git and see if this is good. If it has some bad side effects, please let us know here and I'll revert the patch before the next release. (We want to release this in February.) Happy hacking, -richy. -- Richard B. Kreckel <https://in.terlu.de/~kreckel/>