gcd(m,n) for integer



hi 
Stavros and all

at 2003 jun,we discussed gcd(m,n) concerning about Z homology.
Carl Mactague said
> in math'a [or Gcd(m,n) in yacas] and m and n aren't bound, then
> GCD[m,n] simply remains unaltered wherever it appears.  But in Maxima
> (and perhaps this is really just a poor implementation of GCD and not
> a critique of the Maxima evaluation scheme in general) you get
> GCD(m,n) => 1!  These sorts of barbs seem to arise quite often when I
> use Maxima and they mess up all kinds of boundary conditions.

What do you think this way?
I use a rule evaled infinitly,but controled by maxapplydepth.
 
(%i2) matchdeclare([m,n],true)$
(%i13) defrule(tama,sgcd(m,n),if integerp(m) and integerp(n) then
print(gcd(m,n)) else sgcd(m,n))$
(%i4) maxapplydepth:2;
(%o4)                                  2
(%i5) apply1(sgcd(2,4),tama);
2 
(%o5)                                 2
(%i6) apply1(sgcd(n1,n2),tama);
(%o6)                           sgcd(n1, n2)
(%i7) apply1(sin(sgcd(2,4)),tama);
2 
(%o7)                              SIN(2)
(%i8) tgcd(_m,_n):=apply1(sgcd(_m,_n),tama)$ 
(%i9) sin(tgcd(x,y));
(%o9)                          SIN(sgcd(x, y))
(%i10) sin(tgcd(5+3,6!));
8 
(%o10)                 SIN(8)

I think that
to control infinit loop with maxapplydepth makes us get ride 
of the barbs which Carl said about Maxima.

gosei