matchdeclare syntax



Thanks to R. Fateman and Robert Dodier for working solutions to my effort to 
use matchdeclare with tellsimp.

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 );
(%o3) [cosrule1,?simp\-%cos]
(%i4) declare(m,integer);
(%o4) done
(%i5) cos(m*%pi);
(%o5) (-1)^m
(%i6) tellsimp( sin(q*%pi) , 0);
(%o6) [sinrule1,?simp\-%sin]
(%i7) sin(m*%pi);
(%o7) 0
(%i8) integerp(m);
(%o8) false

Why does integerp(m) => false, but use in matchdeclare works?
-----------
I realize that the Maxima manual warns that declare(m,integer) does not get 
integerp(m) to be true.
(man:  integerp returns false if its argument is a symbol, even if the 
argument is declared integer. )
---------
Maybe I should learn to read lisp code and look at the insides?
TIA
Ted Woollett