vermaseren / form

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

Print terms into different files #245

Open tueda opened 6 years ago

tueda commented 6 years ago

Is there any possibility to have the Print executable statement, but the output goes to a different file for each term? A possible syntax would be +"<filename>" option (instead of +f):

Print +"<filename>" "<format string>" [<objects>];

Here the file name is also a format string, and then the objects are also consumed for the file name. For example,

Print +"foo-%$.out", "%$", $n, $expr;

Because the number of output files can be too many, the Print statement should immediately close the file after writing. Maybe just in the "w" mode or just in the "a" mode. Preferably the first Print for each file in the "w" mode and after that in the "a" mode, which requires keeping the set of file names for already opened files in a memory efficient way.