pdiff + tellsimpafter behaves differently inside function
Subject: pdiff + tellsimpafter behaves differently inside function
From: Stavros Macrakis
Date: Wed, 2 Jan 2013 07:50:06 -0500
The ''x (two single quotes) syntax means "evaluate at read time". You
probably need to use apply('repopulated,...) to evaluate at execution time.
Also, to make function F local, it isn't enough to make the variable F
local; use local(...).
-s
On Jan 2, 2013 6:57 AM, "Nijso Beishuizen" <nijso at hotmail.com> 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))
> )$
>
>
> 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
>