Jeroen Demeyer on Fri, 22 Sep 2006 10:12:16 +0200

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Multiple substitutions (wishlist)

Hello list,

Many times I have wanted to do some kind of "multiple simultaneous subst()" in PARI/GP. I mean the following:

gp> subst(x^2 + 3*y, x,y, y,z)
%1 = y^2 + 3*z

Where the 2nd argument is replaced by the 3rd, the 4th by the 5th, and so on...

I have absolutely no idea how easy/difficult it would be to implement this, but I would appreciate it :-) One non-trivial point it that the subst()s have to happen simultaneously, to make things like subst(f, x,y, y,x) possible (which would swap x and y in the expression f).