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

Re: Pattern example

  • To: mathgroup at
  • Subject: [mg19309] Re: [mg19284] Pattern example
  • From: "Kevin J. McCann" <kevinmccann at>
  • Date: Sat, 14 Aug 1999 23:42:44 -0400
  • References: <>
  • Sender: owner-wri-mathgroup at


Your replacement t_->c looks at the FullForm of the rest of your expression,
and takes the first object that satisfies t_ (which is anything), and
replaces it with c.  Thus you end up with the "unexpected result".

i.e. {{1+a},{2+a},{3+a}} fits the bill for "t_" and so mma replaces the
whole mess, it doesn't wait to see what is inside to do the replacement.


----- Original Message -----
From: chris <senisen at>
To: mathgroup at
Subject: [mg19309] [mg19284] Pattern example


> Then
> {{1+a},{2+a},{3+a}}  /.  t_->c
> c
>  this is no more a list, but
> FullForm[{{1+a},{2+a},{3+a}}  /.  {t_}->c]
> List[c,c,c]
> shows it as a list
> What is behind this difference?

  • Prev by Date: Tricky Symbolizations with the Notation Package (Was Subscripts, Doh!!!)
  • Next by Date: Control Function With NDsolve
  • Previous by thread: Pattern example
  • Next by thread: Re: Pattern example