Open tueda opened 7 years ago
Might be nice also for functions as
CF f(s);
L F = f(1,2,3);
multiply id_(f,dummy_);
* id f(?a) = 1; * compile-time error
* multiply replace_(f,dummy_); * dangerous, not only the ground level
P;
.end
though I don't know the exact meaning of dummy_
yet (#143).
Better if it works also for indices.
And how would you do that. For functions id f = dummy; is different from id f(?a) = dummy(?a); Because id is a function Multiply id(f(?a),dummy(?a)); Cannot work either, because ?a is not defined in a LHS. In general the id cannot work with wiuldcards in the same way as the id statement can. With normal wildcard variables one could envision Multiply id(x,y,f(x,y),dummy(x,y)); to mean that x and y should be seen as wildcards in the LHS that will be generated, but this still excludes the use of ?a type wildcards. Anyway, in your example f is a symmetric function and f(?a) cannot work either in the current pattern matcher.
Suggestions?
Jos
On 24 Nov 2017, at 18:12, Takahiro Ueda notifications@github.com wrote:
Better if it works also for indices.
— 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/155#issuecomment-346871112, or mute the thread https://github.com/notifications/unsubscribe-auth/AFLxEp7oSFhdFpUrZfny4hV0H5EYF3Xqks5s5vj2gaJpZM4LEMy5.
You are right for id_
for functions. Actually what one needs (and may expect for id
) is `replace` with specifying the level where the substitution is performed.
It would be nice to extend the functionality of
id_
also for vectors.currently gives
This is an easy way to dynamically replace dot products in numerators (including squared ones) while untouching denominators. (
replace_
affects on both numerators and denominators).