On Mon, 30 Mar 2026 at 23:34, Richard B. Kreckel <kreckel@in.terlu.de> wrote:
This is obviously due to the fact that, in ginsh, assigning a symbol triggers a substitution of that symbol in all other assignments.
See commit 22716a2cc7.
Oh, wow. Thanks a lot. Yes, that seems to be it. In my use case there are many variables, all assigned only once, and none are used before assignment (as it would be in e.g. C++), so the subs() from that commit are guaranteed to do nothing... I think I'll need to revert it; the performance penalty is too great. I do wish there was a way to opt out. I'm not happy about carrying patches. At least for my use case, the "new" behavior from 1.4.4 [1] is the way to go. I guess there are two types of assignment: retroactive ("old", aka current, aka Mathematica-style), and scope-inducing ("new", aka reverted in 22716a2cc7). Maybe a compromise would be a separate operator for each? I.e. "=" for one and ":=" for the other? Then two hash tables could be maintained: one for substitutions in newly parsed expressions, and one for patching evaluation results? "=" would add the mapping to both, ":=" would only add to the first? This way I could switch to ":=" and not suffer the performance penalty. Or maybe it would be possible to introduce the two hash tables, and only add to the first if the symbol being assigned has already been used (which is never the case in my usage)? Then we get the same effect, but no need for new syntax. In any case, thanks again. [1] https://www.ginac.de/pipermail/ginac-devel/2024-December/002655.html Best regards, Vitaly