MathGroup Archive 2008

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

Search the Archive

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


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