Re: Problem overriding simple built-in functions
- To: mathgroup at smc.vnet.net
- Subject: [mg28809] Re: Problem overriding simple built-in functions
- From: "Orestis Vantzos" <atelesforos at hotmail.com>
- Date: Mon, 14 May 2001 01:33:01 -0400 (EDT)
- Organization: National Technical University of Athens, Greece
- References: <9dld4j$o9b@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
GCD is a protected Symbol, so you can't add any new definitions. Try Unprotect[GCD] first...and don't forget to Protect[GCD] after you make the new assignment. Orestis "Jean-Christophe Deschamps" <jchd at worldnet.fr> wrote in message news:9dld4j$o9b at smc.vnet.net... > 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. >