Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

Re: perplexed by blank sequence in pattern replacement

  • To: mathgroup at smc.vnet.net
  • Subject: [mg68745] Re: perplexed by blank sequence in pattern replacement
  • From: "J Siehler" <jsiehler at gmail.com>
  • Date: Fri, 18 Aug 2006 03:11:45 -0400 (EDT)
  • References: <ebuj5d$6f5$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Blake wrote:

> I expected Out[1]={a,b,c}, from a naieve reading of the full form of
> a*b*c
> In[2]:=FullForm[a*b*c]
> Out[2]//FullForm=Times[a,b,c]

Incidentally, it's worth mentioning that in this example all you want
to do is change the head of an expression (from Times to List).  Apply
does that very very quickly, without messing around with patterns.

In[20]:=
Apply[List,a*b*c]

Out[20]=
{a,b,c}

List@@(a*b*c) is a variant syntax for the same thing.  Of course, this
example may be simpler than what you ultimately intended to do.


  • Prev by Date: Re: Several functions in a single 2D-plot
  • Next by Date: RE: product formula in mathematica
  • Previous by thread: Re: perplexed by blank sequence in pattern replacement
  • Next by thread: too many special linear matrices