MathGroup Archive 2009

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

Search the Archive

Nesting functional commands

  • To: mathgroup at smc.vnet.net
  • Subject: [mg102875] Nesting functional commands
  • From: Erin Noel <enoel2 at gmail.com>
  • Date: Tue, 1 Sep 2009 03:51:31 -0400 (EDT)

Hi,

So how would you go about nesting a functional command inside of another
functional command? For example, say A={1,2,3,4}, then 3*#&/@A = {3,6,9,12}.
No problem. But then what if, within that vector {3,6,9,12}, I wanted to use
the Select command to choose elements less than, say 7. The command
Select[3*#&/@A,#<7&] doesn't work because, as far as I can tell, Mathematica
doesn't know which "#" belongs to Select and which "#" belongs to the &/@
mapping over A. I know that I could define 3*#&/@A as a new variable and
then use that new variable in the Select command, but is there any way to
nest multiple commands in this way?

Thanks a lot in advance,
Erin



  • Next by Date: Simplifying If expressions
  • Next by thread: Re: Nesting functional commands