Services & Resources / Wolfram Forums
MathGroup Archive
*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: Forcing Argument Evaluation

  • To: mathgroup at
  • Subject: [mg49906] Re: [mg49848] Forcing Argument Evaluation
  • From: Andrzej Kozlowski <akoz at>
  • Date: Thu, 5 Aug 2004 09:22:28 -0400 (EDT)
  • References: <>
  • Sender: owner-wri-mathgroup at

On 4 Aug 2004, at 16:46, Scott Guthery wrote:
> f[x_] := x^2;
> a = {f,f/2};
> a[[1]][2]
> 4
> a[[2]][[2]
> f/2[2]
> I know I'm missing something fundamental.
> Cheers, Scott

It's the same problem again, which I already once explained. The 
algebra of functions is not implemented in Mathematica so although f is 
a function f/2 is not a function. So you can't expect f/2[2] to have 
return anything. If you really want implement the algebra of fucntions 
you could do something like this:


(a_?NumericQ * f_)[x_]:=a f[x]





Andrzej Kozlowski
Chiba, Japan

  • Prev by Date: Re: Re: Does anybody?
  • Next by Date: Re: NonlinearFit
  • Previous by thread: Re: Forcing Argument Evaluation
  • Next by thread: Re: Forcing Argument Evaluation