substituting function in diff



On Wed, Jul 15, 2009 at 8:06 AM, David Webb<david.webb at noc.soton.ac.uk> wrote:

> On Tuesday 14 July 2009 18:24:59 Stavros Macrakis wrote:
>> I'm not sure I understand your whole problem, but have you taken a look at
> substpart?
>>
>> You can do things like
>>
>> substinpart( myfavoritefunction( piece ) , expr, 2, 2, 1 )
>>
>> which extracts inpart(expr,2,2,1), calls your function on it, and returns an
> expression with the value in place of the original subexpression.

> Many thanks - this is just what I wanted. ?I thought I had read all the
> relevant bits of the manual but ... . ?I had also tried '?? replace' but
> not '?? inpart'!

I dunno. I can't really recommend using inpart or other part-hacking functions.
How could anyone (for example, yourself next week or next year)
figure out what is the intended effect of substinpart(foo(bar), baz, x, y, z) ??

I'll recommend subst, funmake, op / args, and buildq instead.

FWIW

Robert Dodier