       Re: Re: Re: Language vs. Library

• To: mathgroup at smc.vnet.net
• Subject: [mg61243] Re: [mg61236] Re: Re: Language vs. Library
• From: Andrzej Kozlowski <andrzej at yhc.att.ne.jp>
• Date: Fri, 14 Oct 2005 05:53:28 -0400 (EDT)
• References: <dii8o0\$9cc\$1@smc.vnet.net> <200510130539.BAA04590@smc.vnet.net>
• Reply-to: Andrzej Kozlowski <andrzej at akikoz.net>
• Sender: owner-wri-mathgroup at wolfram.com

```I have no idea how your questions relate to all this stuff about
Mathematica's core language, since they involve very basic
misunderstandings:

On 13 Oct 2005, at 14:39, Steven T. Hatton wrote:

> Try this:
>
> A = Array[a (10#1 + #2) &, {3, 3}]
> v = {x, y, z}
> A.v // MatrixForm
> Clear[A,v];
> A = Array[a (10#1 + #2) &, {3, 3}] // MatrixForm
> v = {x, y, z} // MatrixForm
> A.v
>
> Why are the results different?

Because you forgot parentheses:

> A = Array[a (10#1 + #2) &, {3, 3}]
> v = {x, y, z}
> A.v // MatrixForm
> Clear[A,v];
> A = Array[a (10#1 + #2) &, {3, 3}] // MatrixForm
> v = {x, y, z} // MatrixForm
> A.v

A = Array[a (10#1 + #2) &, {3, 3}]
(v = {x, y, z})//MatrixForm
A.v // MatrixForm
Clear[A, v];
(A = Array[a (10#1 + #2) &, {3, 3}] ) // MatrixForm
(v = {x, y, z}) // MatrixForm
A.v // MatrixForm

No difference.

> Explain this:
>
> Clear[a, i]
> a[i] = eye;
> i = 3;
> a = three;
> Print["a[i]=", a[i]]
> Clear[i];
> Print["a[i]=", a[i]]
>

Clear[a, i]
a[i] = eye;
i = 3;
a = three;

We check what Mathematica knows about the symbols a and i:

DownValues[a]

{HoldPattern[a] :> three, HoldPattern[a[i]] :> eye}

?i

Global`i

i=3

Print["a[i]=", a[i]]

"a[i]="three

Naturally since the rule (DownValue)  a= three applies.

Clear[i];

Now i has no value:

?i

Global`i

Print["a[i]=", a[i]]

"a[i]="eye

Now the rule  (DownValue) a[i]=eye applies.

Andrzej Kozlowski
Tokyo, Japan

```

• Prev by Date: Re: big integer for Range
• Next by Date: Re: "Leibnitz" from for partial differentiation?
• Previous by thread: Re: Re: Language vs. Library
• Next by thread: Re: Re: Re: Language vs. Library