Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*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 2004

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

Search the Archive

Re: foreach loop

  • To: mathgroup at smc.vnet.net
  • Subject: [mg51956] Re: [mg51868] foreach loop
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Fri, 5 Nov 2004 02:19:30 -0500 (EST)
  • Reply-to: hanlonr at cox.net
  • Sender: owner-wri-mathgroup at wolfram.com

f /@ {fall,winter, spring,summer}

{f[fall], f[winter], f[spring], f[summer]}


Bob Hanlon

> 
> From: "symbio" <symbio at has.com>
To: mathgroup at smc.vnet.net
> Date: 2004/11/04 Thu AM 01:49:09 EST
> To: mathgroup at smc.vnet.net
> Subject: [mg51956] [mg51868] foreach loop
> 
> Is there a foreach loop statement in Mathematica?  I need to loop through a 
> list of words, rather than numbers.  I need the equivalent of Do[expr, 
> {n,0,10,1}], except I need to step through a list like so:  foreach loop 
> [expr, {fall, winter, spring, summer}].  Can anyone help? 
> 
> 


  • Prev by Date: Re: Counting Runs
  • Next by Date: Re: foreach loop
  • Previous by thread: Re: foreach loop
  • Next by thread: Re: foreach loop