Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Re: Transform list of numbers into pure functions using replace rule

  • To: mathgroup at smc.vnet.net
  • Subject: [mg89491] Re: Transform list of numbers into pure functions using replace rule
  • From: Steven Siew <stevensiew2 at gmail.com>
  • Date: Wed, 11 Jun 2008 03:15:28 -0400 (EDT)
  • References: <g2lb8t$964$1@smc.vnet.net>

Er?

  What about this?

If[NumberQ[#],ToExpression[ToString[#]<>"&"],#] & /@ {1,2,3&,f[x]}
FullForm[%]


{1,2,f[x]} /. x_ /; NumberQ[x] -> Function[x]
FullForm[%]

Steven Siew


  • Prev by Date: Re: snippets
  • Next by Date: How to test if list of arguments are numeric
  • Previous by thread: Re: Transform list of numbers into pure functions using replace rule
  • Next by thread: Re: Transform list of numbers into pure functions using replace rule