Open jodavies opened 7 years ago
I agree that FORM should detect such user mistakes, though it might be a bit tricky for the compiler because global expressions in the right-hand side can have arguments, like
V q1,q2;
CF mom,foo;
.global
G test(q1) = mom(q1,q2)*foo(q1);
.store
V p1,p2;
L FF = mom(p1,p2);
id mom(q1?,q2?) = test(q1);
P;
.end
The compiler should care of (1) whether an expression in the right-hand side is global and has been stored, and then (2) the number of allowed arguments.
I fully agree that an error message would not be misplaced. I always learned that in writing compilers, error messges is one of the very difficult things. This seems to illustrate this. Somehow one must anticipate ‘all possible errors’. !!! I once read the following joke about it: "Just when you think you made it foolproof, somebody invents a better fool.” Just remember that when you give your programs to other people. Alternatively the Goedel, Escher, Bach book kind of explains that it is impossible.
Considering that this is an issue now, it will be picked up sooner or later.
Cheers
Jos
On 8 feb. 2017, at 17:48, Takahiro Ueda notifications@github.com wrote:
I agree that FORM should detect such user mistakes, though it might be a bit tricky for the compiler because global expressions in the right-hand side can have arguments, like
V q1,q2; CF mom,foo; .global
G test(q1) = mom(q1,q2)*foo(q1); .store
V p1,p2;
L FF = mom(p1,p2);
id mom(q1?,q2?) = test(q1);
P; .end The compiler should care of (1) whether an expression in the right-hand side is global and has been stored, and then (2) the number of allowed arguments.
— 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/168#issuecomment-278385633, or mute the thread https://github.com/notifications/unsubscribe-auth/AFLxEuB1HlAxbLv1htLQSLI5Qdo5fuhlks5rafHggaJpZM4L7DJC.
I (accidentally) wrote an Identify statement as follows, intending
test
to be a CFunction, when in fact it is the name of the Local expression.This gives,
which should yield a syntax error, should it not?
Thanks, Josh.