MathGroup Archive 2003

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

Search the Archive

Re: Functional programming

  • To: mathgroup at smc.vnet.net
  • Subject: [mg39025] Re: [mg39015] Functional programming
  • From: "Y.A.Tesiram" <yas at pcomm.hfi.unimelb.edu.au>
  • Date: Sat, 25 Jan 2003 01:24:06 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,
f[a_, b_] := a + b

With[{b = 4}, HoldForm[f[#, b]] & /@ {1, 2, 3, 4}]

{f[1, 4], f[2, 4], f[3, 4], f[4, 4]}

Yas


On Fri, 24 Jan 2003, Zachary Turner wrote:

> I have a function f[a_,b_] defined some way.  i want to fix one argument,
> and then generate an array of values where the other argument varies.  How
> can I do this?
>
> For example, I want:
>
> {f[1, 4], f[2, 4], f[3, 4], f[4, 4]}
>
> Is there an easy way to do this?
>
> Thanks
>
>
>



  • Prev by Date: Re: Functional programming
  • Next by Date: Re: Do Loop storing the outputs
  • Previous by thread: Re: Functional programming
  • Next by thread: Re: Functional programming