Re: perplexed by blank sequence in pattern replacement
- To: mathgroup at smc.vnet.net
- Subject: [mg68707] Re: perplexed by blank sequence in pattern replacement
- From: "J Siehler" <jsiehler at gmail.com>
- Date: Thu, 17 Aug 2006 04:18:14 -0400 (EDT)
- References: <ebuj5d$6f5$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Blake wrote: > In[1]:=Replace[a*b*c,Times[mysequence__]:>{mysequence}] > Out[1]={a b c} > I expected Out[1]={a,b,c}, from a naieve reading of the full form of > a*b*c Times[mysequence__] was evaluated to yield just mysequence__ before the replacement began. You can put Trace[ ... ] around your original command to see what happened. This will do what you want: Replace[a*b*c, HoldPattern[Times[mysequence__]] :> {mysequence}]