matchdeclare syntax



Try something like:

(%i1) matchdeclare(q, lambda([x], featurep(x, 'integer)))$
(%i2) tellsimp(fff(q*%pi), (-1)^q)$

(%i5) fff(6*%pi);
(%o5) 1

(%i6) fff(7 * %pi);
(%o6) -1

(%i7) declare(m,integer)$

(%i8) fff(m * %pi);
(%o8) (-1)^m

Barton

-----maxima-bounces at math.utexas.edu wrote: -----

>Another example that seems to work ok, but which seems counter-intuitive,
>involves the use of declare and integerp:
>
>(%i1) display2d:false$
>(%i2) matchdeclare(q,integerp);
>(%o2) done
>(%i3) tellsimp( cos(q*%pi), (-1)^n );