MathGroup Archive 2005

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

Search the Archive

Re: Re: Re: Language vs. Library

  • To: mathgroup at smc.vnet.net
  • Subject: [mg61326] Re: Re: Re: Language vs. Library
  • From: "Steven T. Hatton" <hattons at globalsymmetry.com>
  • Date: Fri, 14 Oct 2005 22:23:49 -0400 (EDT)
  • References: <dinvua$s8s$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

David Annetts wrote:

> Hi Steve,
>  
> This code is actually working properly.  If you meant to show the
> calculation in matrix form, then what you should have written in the
> second part of the example was
> 
> MatrixForm[A = Array[a (10#1 + #2) &, {3, 3}]]
> MatrixForm[v = {x, y, z}]
> MatrixForm[A.v]

Yes, but the question was _why_ does it work the way it does. This helps
explain it:

a[row_, col_] := "a" <> ToString[(10row + col)]
A = Array[a[#1, #2] &, {3, 3}];
v = {x, y, z};
FullForm[A.v // MatrixForm]
Clear[A, v];
A = Array[a[#1, #2] &, {3, 3}] // MatrixForm;
v = {x, y, z} // MatrixForm;
FullForm[A.v]

But how does one explain that behavior in formal terms?

>> Explain this:
>> 
>> Clear[a, i]
>> a[i] = eye;
>> i = 3;
>> a[3] = three;
>> Print["a[i]=", a[i]]
>> Clear[i];
>> Print["a[i]=", a[i]]
> 
> This is also working correctly.  Although you've cleared i, you haven't
> cleared the symbol a[i].  You can see this by evaluating ??a after your
> final Print[].  You might also want to try a similar trick with i

Now how do I put these observations into formal terms?  That's what I'm
driving at.

Is there a formal distinctions between "functions" and "commands" in
Mathematica?  That may actually be addressed somewhere in The Mathematica
Book.  It's been a very long time since I read the first sections.  What
about "operators"?  There are symbols which act as operators.  One of those
symbols is whitespace.  But are these symbols really fundamental to
Mathematica?  Is there anything in Mathematica which cannot be represented
as a combination of alphanumeric ascii characters, commas, periods, square
brackets, semicolons and backslashes?
-- 
"Philosophy is written in this grand book, The Universe. ... But the book
cannot be understood unless one first learns to comprehend the language...
in which it is written. It is written in the language of mathematics, ...;
without which wanders about in a dark labyrinth."   The Lion of Gaul


  • Prev by Date: Re: Re: Re: Language vs. Library why it matters
  • Next by Date: Re: Re: SingularValueDecomposition bug: fifty examples
  • Previous by thread: Re: Language vs. Library
  • Next by thread: Re: Language vs. Library