MathGroup Archive 2006

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

Search the Archive

Re: Rules

  • To: mathgroup at
  • Subject: [mg66378] Re: Rules
  • From: dh <dh at>
  • Date: Thu, 11 May 2006 02:15:05 -0400 (EDT)
  • References: <e3shji$m3u$>
  • Sender: owner-wri-mathgroup at

Hi Marcin
see below, Daniel

Marcin Rak wrote:
> Hey everyone,
> I had two simple questions, and was wondering wether anyone could through
> something my way:
> 1) When we have a list, call it AList, and we type the following
> AList /. {rule1}
braces are needed when you have more than one rule
> AList /. rule1
> what is the difference between the two?  And, how would I go about
> defining a rule for the variable AList, and a rule for the contents of the
> list - obviously these are two different concepts, yet how would you
> differentiate b/w the two?
A rule for a whole list:
{1, 2, 3} /. {a_, b_, c_} -> {a, c}
or a rule for single elemnts:
{1, 2, 3} /. 2->5
> Thanx to all
> MR

  • Prev by Date: RE: Question on Map or Apply
  • Next by Date: Re: Creating a new table using values from a column in another table,
  • Previous by thread: Re: Rules
  • Next by thread: Re: Rules