MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Problem overriding simple built-in functions


Hi,

I'm told the following occurs under Mathematica v4.0:

In[1]:= GCD[{3, 6}]
Out[1]= {3, 6}
In[2]:= GCD[x_List] := Apply[GCD, x]
In[3]:= GCD[{3, 6}]
Out[3]= GCD[{3, 6}]
In[4]:= Apply[GCD, {3, 6}]
Out[4]= 3

Why is it so? It looks like the override is ignored, but why?

The same exerpt seems to work fine under version 2.x.


  • Prev by Date: Re: i don't want intersection
  • Next by Date: variables versus functions
  • Previous by thread: Re: Det[]
  • Next by thread: Re: Problem overriding simple built-in functions