MathGroup Archive 2005

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

Search the Archive

Map, List

  • To: mathgroup at smc.vnet.net
  • Subject: [mg55066] Map, List
  • From: Steve Gray <stevebg at adelphia.net>
  • Date: Fri, 11 Mar 2005 04:20:42 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

	I wanted to convert

{a,b,c} to
{{a},{b},{c}}, (just an example)

and it occured to me that since List[xx] = {xx}, I could do

ml=Map[List,{a,b,c}] and get
ml={{a},{b},{c}},

making List in this case the inverse of Flatten. Now,assuming a,b,c have appropriate integer values,
I can do

Delete[ggon, ml]

where ggon is a list from which I want to delete an arbitrary set of list members.

Of course this worked. My only problem is that I might  not have thought of this obvious (in
retrospect) operation. Using List as a function is not mentioned in any of my several books. What
general principle applies that makes all such things functions?

Thank you.

Steve Gray


  • Prev by Date: Re: Google's aptitude test equation
  • Next by Date: Printing in color
  • Previous by thread: Re: Re: Determinant problem
  • Next by thread: Re: Map, List