Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: ReplaceAll and BlankNullSequence

  • To: mathgroup at smc.vnet.net
  • Subject: [mg100543] Re: ReplaceAll and BlankNullSequence
  • From: lshifr at gmail.com
  • Date: Sun, 7 Jun 2009 05:02:49 -0400 (EDT)
  • References: <h0d6tt$sqe$1@smc.vnet.net>

Hi,

Try starting with a fresh kernel, or at least Clear[x]- it looks like
your x is globally defined as x = 1. Also/alternatively, use delayed
rule:   {kevinbacon, iscool} /. {x___, iscool} :> {x}, in which case
possible global definitions for x don't matter.

Regards,
Leonid


On Jun 6, 12:47 am, Philip R Dutton <fooledbypri... at gmail.com> wrote:
> I keep getting {1} when I try to do a simple replacement with this code:
>
> {kevinbacon, iscool} /. {x___, iscool} -> {x}
>
> Why doesn't the output show {kevinbacon} ???
>
> I am so confused...
>
> Thanks for the help!!!



  • Prev by Date: Re: ReplaceAll and BlankNullSequence
  • Next by Date: Re: Rasterize off by one pixel
  • Previous by thread: Re: ReplaceAll and BlankNullSequence
  • Next by thread: Mathematica bug??