A workaround for the inefficient SUBST command  Printable Version + HP Forums (https://archived.hpcalc.org/museumforum) + Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum1.html) + Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum2.html) + Thread: A workaround for the inefficient SUBST command (/thread245915.html) 
A workaround for the inefficient SUBST command  peacecalc  07022013 For all HP 50g users, The SUBST command works only correct for substituting names, but not for expressions, like "X=SIN(R*T)" when you have additonal names "R" or "T" in the expression where you want to substitute the "X". A little program is able to overcome that behavier. I wrote this because of a thread in the hp own calculator forum with that topic. Thank you pin224466 (that person who started the thread) for clarifying that problem. I have to post here, because I left the hp own forum some time ago. I hope that is okay to go that way.
<< EQ> 2 >LIST > MATCHLST As Input you have same syntax like for SUBST, but ist works now fine without isolating to other names. And even better it can be used with placeholders as "&A"! For example:
STACK 2: 'COS(3*X+7*SIN(X^2  R*T))'
Re: A workaround for the inefficient SUBST command  Gilles Carpentier  07022013 Well done ... But I think
\<< EQ\> 2 \>LIST \^MATCH DROP \>>
is sufficiant ?
Re: A workaround for the inefficient SUBST command  peacecalc  07032013 Hello Gilles, your solution is more elegant and shorter and it has the same functionalty. Thank you, for improving the code. My fault was to think, that the MATCH command only works subtituting the pattern founded on the same level (that make sense for outputting the result code zero or one). But MATCH works in one run even for nested expressions. It seems to be a recurrence program.
Greetings Re: A workaround for the inefficient SUBST command  Gilles Carpentier  07032013 The MATCH command is very powerfull. Here is an example to extend the capacity of the CAS with some "sum" functions :
@ Exact mode If you use EEVAL instead of EVAL, the 50G now knows that :
'\GS(n=0, +\oo, (5/n!)*sin(x)^n)'
Edited: 3 July 2013, 5:22 p.m.
