pdiff + tellsimpafter behaves differently inside function



On 1/2/13 3:56 AM, Nijso Beishuizen wrote:
> Dear all,
>
> I am trying to rewrite some things using pdiff, so I first load(pdiff).
> When I then enter the code below as separate statements on the command line in
> maxima, tellsimpafter will work and simplify the expression to g(1). However,
> when I place it inside a function, it will complain, saying:
>
> tellsimpafter: pattern must not be an atom; found: h1
> #0: test()(test.mac line 6)
>
> here's the code:
>
> test() := block([expr,f,g,df,h1,F],
>    expr : diff(f(x), x)*g(y),
>    F(xx,yy) := at(expr, [x = xx,y=yy]),
>    df:diff(f(x),x),
>    h1:subst(1,x,df),
>    tellsimpafter(''h1,1),
>    print(F(1,1))
> )$

''h1 means something different inside a function.
maybe you mean  apply(tellsimpafter, h1,1) ?  or more likely you should 
write  ratsubst(1,h1, F(1,1)) ,  just a guess though.

>
>
> I also tried switching off debugging stuff from a maxima function using the
> lisp function from Robert Dodier, but that didn't work, so I guess this is
> something else (btw, Robert, thanks for the fix!). Does somebody know what
> goes wrong here?
>
> Best,
> NB
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima