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

Allow simple arithmetic for set substitution indices #249

Open tueda opened 6 years ago

tueda commented 6 years ago

It may be convenient if the following code works:

S n,x1,x2,x3;
Set xx: x1,x2,x3;
CF f;
L F = f(1);
id f(n?) = xx[n] * xx[n+1] * xx[n+2];
P;
.end

which currently gives

test.frm Line 5 --> Improper set argument in RHS
test.frm Line 5 --> Improper set argument in RHS
vermaseren commented 6 years ago

There is an easy workaround for this case. id f(n?) = f(n,n+1,n+2); id f(n?,n1?,n2?)= xx[n]xx[n1]xx[n2]; I admit, it is nor elegant, but to make it work as you ask, asks for very serious internal changes.

Jos

On 6 Dec 2017, at 20:09, Takahiro Ueda notifications@github.com wrote:

It may be convenient if the following code works:

S n,x1,x2,x3; Set xx: x1,x2,x3; CF f; L F = f(1); id f(n?) = xx[n] xx[n+1] xx[n+2]; P; .end which currently gives

test.frm Line 5 --> Improper set argument in RHS test.frm Line 5 --> Improper set argument in RHS — 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/249, or mute the thread https://github.com/notifications/unsubscribe-auth/AFLxEmKHJF8rJChGKFS-l7sYyIUcQePAks5s9uZYgaJpZM4Q4buQ.

tueda commented 6 years ago

Yes, that is a workaround, though my code needs 9 numbers for one replacement.