Re: Symbol ... in part assignment does not have an immediate value
- To: mathgroup at smc.vnet.net
- Subject: [mg22448] Re: Symbol ... in part assignment does not have an immediate value
- From: "Allan Hayes" <hay at haystack.demon.co.uk>
- Date: Wed, 8 Mar 2000 02:21:48 -0500 (EST)
- References: <89qfik$a9t@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hans,
A symbol gets an immediate value from an assigment using = rather than :=.
For part assigment to work for a symbol it must have an immediate value,
which can, however, have been modified. This is reasonable since part
assignment work directly on the stored rule, so the structure must be
immediately evident and not rely on further evaluations.
d1 = {a, b};
d1[[2]] := 2 + 2;
d1[[1]] = 2 + 2;
Definition[d1] // InputForm
d1 = {4, 2 + 2}
But
d2 := {a, b};
d2[[1]] = 5;
Set::"noval": "Symbol \!\(d2\) in part assignment does not have an immediate
\
value."
Definition[d2] // InputForm
d2 := {a, b}
Allan
---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565
"Hans Friedrich Steffani" <hans.steffani at e-technik.tu-chemnitz.de> wrote in
message news:89qfik$a9t at smc.vnet.net...
>
> If[ N[nullpos[[i, 2]]/nullpos[[i, 3]]] >= 2.0,
> Do[
> nullimpuls[[nullpos[[i, 2]] +
> Round[j nullpos[[i, 2]]/nullpos[[i, 3]]] ]] = -1;
> {j, 1, Round[nullpos[[i, 2]]/nullpos[[i, 3]] ]}]]
>
> i is the iterator of an outer loop.
>
> This code produces:
> Set::"noval": "Symbol \!\(nullimpuls\) in part assignment does not
> have an immediate value."
>
> What's that?
>
> Hans Friedrich Steffani
> --
> Hans Friedrich Steffani
> Institut fuer Elektrische Maschinen und Antriebe, TU Chemnitz
> mailto:hans.steffani at e-technik.tu-chemnitz.de
> http://www.tu-chemnitz.de/~hfst/
>