MathGroup Archive 2005

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

Search the Archive

Re: this is ridiculous...

  • To: mathgroup at
  • Subject: [mg61816] Re: this is ridiculous...
  • From: Bill Rowe <readnewsciv at>
  • Date: Mon, 31 Oct 2005 01:17:09 -0500 (EST)
  • Sender: owner-wri-mathgroup at

On 10/30/05 at 12:43 AM, chris.chiasson at (Chris Chiasson)

>Can anyone replicate the pattern replacement problem I am having
>with Equal?

>In[1]:=d == 2 /. Equal[x__] :> tree[x]
>willow[d, 2] /.  willow[x__] :> tree[x]

>Out[1]=d == 2
>Out[2]=tree[d, 2]
>Out[3]="5.2 for Microsoft Windows (June 20, 2005)"

<original replaced with InputForm to improve readability>

Yes, I get the same result. The issue is the pattern Equal[x___]. Specifically,


So, when Mathematica evaluates the rule, it becomes

True :> tree[x]

and since True doesn't appear in the original expression the output is Equal[d,2].

It appears what you are trying to do is change the Head of Equal[d,2]. Wouldn't it be simpler to do

tree@@Equal[d,2] ?
To reply via email subtract one hundred and four

  • Prev by Date: Re: SymbolName question
  • Next by Date: Re: this is ridiculous...
  • Previous by thread: Re: this is ridiculous...
  • Next by thread: Re: this is ridiculous...