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

MathGroup Archive 2008

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

Search the Archive

Re: Mapping and AppendTo

  • To: mathgroup at smc.vnet.net
  • Subject: [mg91753] Re: Mapping and AppendTo
  • From: Bill Rowe <readnews at sbcglobal.net>
  • Date: Sun, 7 Sep 2008 05:36:17 -0400 (EDT)

On 9/6/08 at 2:08 AM, MSchettler at scitor.com (Schettler, Martin)
wrote:

>I would like mix use of Map and AppendTo in the following way
>(e.g.):

>M = {{0,1,2},{4,5,6,7}};
>AppendTo[#,8]&/@M;

>Of course, this doesn't work, because {0,1,2} is not a symbol
>name,etc. Is there a way to use Hold or Sow to make this construct
>work?

Possibly this could be done with something other than Map. But since

M = {{0,1,2},{4,5,6,7}};
M = Append[#,8]&/@M;

will do what you ask, I see no reason to look further.


  • Prev by Date: Re: Mapping and AppendTo
  • Next by Date: Re: Mapping and AppendTo
  • Previous by thread: Re: Mapping and AppendTo
  • Next by thread: Use of delayed assignment, :=, with a list