MathGroup Archive 1998

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

Search the Archive

Re: tag Times protected??

  • To: mathgroup at smc.vnet.net
  • Subject: [mg13460] Re: [mg13419] tag Times protected??
  • From: "Jurgen Tischer" <jtischer at col2.telecom.com.co>
  • Date: Fri, 24 Jul 1998 01:45:45 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

Hi Jordan,
you could write your assignments into different cells, or you could
write

{ pe[j] , ph[j] , peh[j] }= { pate[[1]] , path[[1]] , pateh[[1]] }


The explanation why all this happens: Mathematica allows chains of
assignments like x=y=0, and multiple line commands. I think both is
nice, but of course your input interpreted this way contains an
assignment to pate[[1]] ph[[j]], say, which is indeed of the form
Times[...]. So the message. If you separate with ; you use still
another possibility: a compound statement. So there is no assignment to
Times, voila.

Jurgen

-----Original Message-----
From: Jordan Milev <jgmilev at amherst.edu> To: mathgroup at smc.vnet.net
Subject: [mg13460] [mg13419] tag Times protected??


>I am writing with an annoying behavior in Mathematica, which I hope has
>a logical explanation.  I have found that sometimes when I write two
>consecutive lines which display output, I get the message "tag Times
>protected"
>
>Say I write:
>
>pe[j] = pate[[1]]
>ph[j] = path[[1]]
>peh[j] = pateh[[1]]
>
>where pate, path, and pateh are lists.  So this is merely an assignment
>exercise, but Mathematica somehow thinks that I've written instead:
>
>pe[j] = pate[[1]]ph[j] = path[[1]]peh[j] = pateh[[1]]
>
>i.e. I'm trying to multiply the three.  Of course, this is an error, so
>Mathematica gives a warning message.  But, if I write the same
>expression as:
>
>pe[j] = pate[[1]];
>ph[j] = path[[1]];
>peh[j] = pateh[[1]];
>
>the problem disappears, and Mathematica doesn't want to multiply the
>three.
>
>Does anyone know why this is happening, or more importantly, how to
>prevent this behavior?  I'd appreciate any help.
>
>Jordan
>
>



  • Prev by Date: Re: Re: Is this a bug?
  • Next by Date: Re: Gaussian Elimination wont work in my example
  • Previous by thread: Re: tag Times protected??
  • Next by thread: writing programs