Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2002
*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 2002

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

Search the Archive

passing functions as parameters

  • To: mathgroup at smc.vnet.net
  • Subject: [mg33988] passing functions as parameters
  • From: GoranG <icmc2MAKNUTIOVO at pop.tel.hr>
  • Date: Thu, 25 Apr 2002 03:00:15 -0400 (EDT)
  • Reply-to: icmc2MAKNUTIOVO at pop.tel.hr
  • Sender: owner-wri-mathgroup at wolfram.com

How would one pass one function to another?

I need to be able to define functions in the following fashion:

f[x_]:=x^3-x+1

g[x_,y_,somefunction?]:=If[somefunction[x]>somefunction[y],"Done","Waiting")

to be able to later on evaluate

g[2.,3., f?]

I have tried couple of paths with no success and would really like to
avoid using global function in function g.

All the best...



  • Prev by Date: A package for an aperiodic tiling of the plane
  • Next by Date: Definite Integrals & Hidden Cells
  • Previous by thread: A package for an aperiodic tiling of the plane
  • Next by thread: Re: passing functions as parameters