MathGroup Archive 2012

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

Search the Archive

Re: altering each member of a list that matches a certain pattern


On 6/20/2012 12:54 AM, Jason Ebaugh wrote:

>
> Am I missing a more straightforward way to do this?
Yes. Why not just...

Table[If[x > 9, SuperStar[x], x], {x, list}]

this does not affect the data in list.

OR


Map[Function[{x}, If[x > 9, SuperStar[x], x]], list]

which is, I expect, just as efficient and far more readable than your

If[# > 9, SuperStar[#], #] & /@ list

The non-alpha sequence [#]#]&/@   is hardly the worst puzzle
that can be constructed in 8 characters, but is, to me
unnecessarily obscure.



  • Prev by Date: Re: altering each member of a list that matches a certain pattern
  • Next by Date: Re: Bug in Sort !?!?
  • Previous by thread: Re: altering each member of a list that matches a certain pattern
  • Next by thread: Re: altering each member of a list that matches a certain pattern