Re: a problem applying Rule
- To: mathgroup@smc.vnet.net
- Subject: [mg10263] Re: a problem applying Rule
- From: Allan Hayes <hay@haystack.demon.co.uk>
- Date: Sat, 3 Jan 1998 05:07:16 -0500
- References: <68csbd$a8l@smc.vnet.net>
N Monomachoff wrote: > Hi there, > I'm using 3.0. > > g[f[f[],a]] /. (n:(f | g))[f[],x__] -> n[f[]] evaluates properly as > g[f[f[]]]. > But after > SetAttributes[f,Orderless] > it no longer works. This doesn't make much sense to me. Is this a bug or > a feature? And is there a way around this? Thanks for any help, > nmonomachoff@msn.com After SetAttributes[f,Orderless] The evaluation of g[f[f[],a]] /. (n:(f | g))[f[],x__] -> n[f[]] goes through g[f[a,f[]]] /. (n:(f | g))[f[],x__] -> n[f[]] hence the result. Is g[f[f[],a]] /. (n:(f | g))[u___,f[],x___] -> n[f[]] g[f[f[]]] of any use? -- Allan Hayes Training and Consulting Leicester, UK hay@haystack.demon.co.uk http://www.haystack.demon.co.uk voice: +44 (0)116 271 4198 fax: +44 (0)116 271 8642