MathGroup Archive 2007

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

Search the Archive

Re: Get list of function variables?


On a second thought, there *are* functions in Mathematica which more
or less correspond to the function concept of other languages.  They
can be defined as

f = #^2 &

or

f = Function[{x}, x^2]

They are less flexible than the pattern definitions, but have the
advantage that they can be specified inline (with the #^2& syntax) and
can be automatically compiled for performance.  You'd need a separate
definition for getVariables to make it work on these kinds of
functions.

Szabolcs


  • Prev by Date: How can I find roots in Mathematica 6?
  • Next by Date: Assign variables to a module
  • Previous by thread: Re: Get list of function variables?
  • Next by thread: Re: Get list of function variables?