MathGroup Archive 2011

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

Search the Archive

Assigning part of indexed object

  • To: mathgroup at smc.vnet.net
  • Subject: [mg119793] Assigning part of indexed object
  • From: "Fabrice P. Laussy" <fabrice.laussy at n0spam-gmail.com>
  • Date: Wed, 22 Jun 2011 07:29:27 -0400 (EDT)

How do you set the part of an indexed object, say:

m[1] = Range[5];

is my indexed object (I could have m[2], etc.). Now I 
want to do something like:

m[1][[1]] = 10;

with effect of having m[1] read:

{10, 2, 3, 4, 5}

but of course the line above evaluates to 1 = 10.

This could be achieved by having a non-indexed object get 
in the way, e.g., m1=m[1], assign m1 and then return to 
m[1]=m1, but I believe there should a more elegant way.


  • Prev by Date: Re: $SyntaxHandler problem
  • Next by Date: Re: Again : Is there a BNF for Mathematica?
  • Previous by thread: Re: $SyntaxHandler problem
  • Next by thread: Re: Assigning part of indexed object