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

MathGroup Archive 2010

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

Search the Archive

Tag List Protected error

  • To: mathgroup at smc.vnet.net
  • Subject: [mg113672] Tag List Protected error
  • From: niobe <ben.carbery at gmail.com>
  • Date: Sun, 7 Nov 2010 05:10:50 -0500 (EST)

Hi,

I am trying to use ReplacePart in a function definition. The function
works using =, but not :=

newX= ReplacePart[x,{y[[1, 1]], y[[2, 1]]} -> x[[y[[1, 1]], y[[2,
1]]]] - y[[2, 2]]]

.. works

update[x, y] := ReplacePart[
 x,
 {y[[1, 1]], y[[2, 1]]} -> x[[y[[1, 1]], y[[2, 1]]]] - y[[2, 2]]
]
.. SetDelayed::write: Tag List in <snip> is Protected.

x and y are just integer lists. The problem seems to be Mathematica
trying to replace the head (List) of the rule in ReplacePart... even
though this is just correct syntax for replace part.

I tried using RuleDelayed but no change. Many functions use rules in
their syntax so this must be a general issue I haven't come across
yet.

cheers

B


  • Prev by Date: Re: Strange diference in outputs!
  • Next by Date: Re: Strange diference in outputs!
  • Previous by thread: Re: How to apply Fourier transform to speech signals?
  • Next by thread: Re: Tag List Protected error