Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

Re: Rules

  • To: mathgroup at smc.vnet.net
  • Subject: [mg66378] Re: Rules
  • From: dh <dh at metrohm.ch>
  • Date: Thu, 11 May 2006 02:15:05 -0400 (EDT)
  • References: <e3shji$m3u$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

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