vermaseren / form

The FORM project for symbolic manipulation of very big expressions
GNU General Public License v3.0
1.01k stars 120 forks source link

#do lvar = expression for very big expression #246

Open tueda opened 6 years ago

tueda commented 6 years ago

Because the Print statement can't be used for different files (see #245), what only one can do is to write terms in the preprocessor. To do this, one needs to enumerate the terms. At first glance #do lvar = expression seems to be used for this purpose, but unfortunately looks a bad idea for very big expressions. All the terms are loaded into a $-variable before the iteration begins. Easily "StageSort" happens. We know that it is too buggy and dangerous for $-variables (e.g., #211).

To me, loading the whole expression into a $-variable sounds overkill. If the copying the expression is really required to protect the original expression, then in principle this can be done into a temporary disk space like spectators, not into memory space, and then the preprocessor can start the iteration for the copied expression on disk.

tueda commented 6 years ago

Indeed, I need keeping brackets, so #do lvar = expression doesn't work and maybe I go for FillExpression. But still #do lvar = expression for very big expression would be a nice improvement.

vermaseren commented 6 years ago

What is needed is the write statement that acts similarly to #write, but then during execution. This would solve your problem. Of course, it would have much in common with the print “…” statement.

Jos

On 24 Nov 2017, at 15:14, Takahiro Ueda notifications@github.com wrote:

Indeed, I need keeping brackets, so #do lvar = expression doesn't work and maybe I go for FillExpression. But still #do lvar = expression for very big expression would be a nice improvement.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vermaseren/form/issues/246#issuecomment-346837577, or mute the thread https://github.com/notifications/unsubscribe-auth/AFLxEoDgw84aXSRADtfFFAfpUpGBE0T7ks5s5s9RgaJpZM4Qp2qh.