MathGroup Archive 2005

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

Search the Archive

Re: rules and lists

  • To: mathgroup at
  • Subject: [mg54250] Re: rules and lists
  • From: "Ingolf Dahl" <ingolf.dahl at>
  • Date: Mon, 14 Feb 2005 21:50:44 -0500 (EST)
  • Reply-to: <ingolf.dahl at>
  • Sender: owner-wri-mathgroup at

Here is one way: use an intermediate variable z, and do it in two steps:

({1, 2, 3, 3, 1, 2} //. {{x___, 1, 2, y___} -> {x, z, y}}) //. 
{{x___, z, y___} -> {x, Sequence[1, 2, 3], y}}

Ingolf Dahl
ingolf.dahl at

-----Original Message-----
From: Erich Neuwirth [mailto:erich.neuwirth at] 
To: mathgroup at
Subject: [mg54250]  rules and lists

I would like to replace sublists of a list to be replaced by another 
list, such that for example the rule
wout tranform
{1,2,3,3,1,2} into
Simply gibbin the transformation rule in the form
does not work.
What is the idiom to do what I want?

  • Prev by Date: solve doesn't solve
  • Next by Date: Re: Using Select with arrays? (Relative newbie)
  • Previous by thread: Re: rules and lists
  • Next by thread: Re: rules and lists