Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1999

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

Search the Archive

Pattern example

  • To: mathgroup at
  • Subject: [mg19284] Pattern example
  • From: senisen at (chris)
  • Date: Sat, 14 Aug 1999 01:45:11 -0400
  • Organization: My Org
  • Sender: owner-wri-mathgroup at

I am trying to learn how to use patterns and replacements,
for instance this example:

{{1+a},{2+a},{3+a}}  /.  {t_+a}->c

FullForm[{{1+a},{2+a},{3+a}}  /.  {t_+a}->c]
FullForm= List[c,c,c]

So far so good

{{1+a},{2+a},{3+a}}  /.  t_->c
 this is no more a list, but

FullForm[{{1+a},{2+a},{3+a}}  /.  {t_}->c]
shows it as a list

What is behind this difference?


  • Prev by Date: Multiple html links
  • Next by Date: Re: circumference of an ellipse
  • Previous by thread: Multiple html links
  • Next by thread: Re: Pattern example