Re: Defining a flat, orderless, one-identical function?
- To: mathgroup at smc.vnet.net
- Subject: [mg28121] Re: Defining a flat, orderless, one-identical function?
- From: "Allan Hayes" <hay at haystack.demon.co.uk>
- Date: Sat, 31 Mar 2001 02:58:53 -0500 (EST)
- References: <200103290824.DAA03033@smc.vnet.net> <B6E8D3A8.BC10%andrzej@platon.c.u-tokyo.ac.jp> <9a1l0p$aav@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
The following behaviour is intriguing: It seems to arise because in the
first form, the attributes are, understandably, not attached to max by the
setting max[a] := a
ClearAll[max]
max[a_]:=a;
SetAttributes[max,{Flat,OneIdentity,Orderless,NumericFunction}]
max[a]
a
max[a,b]
max[a,b]
BUT
ClearAll[max]
SetAttributes[max,{Flat,OneIdentity,Orderless,NumericFunction}]
max[a_]:=a;
max[a]
a
max[a,b]
$RecursionLimit::reclim:Recursion depth of 256 exceeded.
Hold[max[a,b]]
--
Allan
---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565
- References:
- Defining a flat, orderless, one-identical function?
- From: Ralph Benzinger <mma-l@endlos.net>
- Defining a flat, orderless, one-identical function?