MathGroup Archive 2005

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

Search the Archive

Re: Re: 2.9.2 How Input and Output Work

  • To: mathgroup at smc.vnet.net
  • Subject: [mg61902] Re: [mg61875] Re: 2.9.2 How Input and Output Work
  • From: Chris Chiasson <chris.chiasson at gmail.com>
  • Date: Fri, 4 Nov 2005 05:11:23 -0500 (EST)
  • References: <200511010539.AAA15747@smc.vnet.net> <dk9vr5$6su$1@smc.vnet.net> <200511030958.EAA26520@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

The syntactic rules, to me, are rules for parsing input into FullForm
expressions. There are some areas of Mathematica where these rules are
not available, such as certain initialization files. In those files,
only the regular head[arguments] scheme works.

There are many rules for parsing... in addition to processing boxes
into certain Mathematica operations, certain inputs are recognized as
prefix, infix, matchfix or postfix operators... like um...
prefix @@
infix + or ==
matchfix (like infix but has ends) {,,}
postfix //

there are other *fix operators, but I am ignoring them.
These different operators all have a different precedence which leads
to a different order of operations (just like regular Math defines
1-2/1=0 instead of -1/2). Mathematica would be a ridiculous pain in
the butt for which to program without operators. One wouldn't even be
able to write 2+2 and get out 4.

There is a long description, somewhere in the documentation, about
what happens to input as it is evaluated.

Please let us know if you find out how the kernel and notebook FE
interact when it comes to input.

Instructive places to start might be to look at how Mathlink tells the
kernel to do calculations, or to look at how other front ends (like
the old one for EMACS, I think, ~ version 2.0) handled talking to the
kernel.

On 11/3/05, Steven T. Hatton <hattons at globalsymmetry.com> wrote:
> bsyehuda at gmail.com wrote:
>
> > The parsing is done by the Kernel, so "immediately" is when you evaluate
> > the expression.
> > In addition, the "Cell[BoxData[...." that you may see in the front end is
> > not the expression that is passed to the kernel. This expression is
> > converted to another format that is passed to the kernel which in turn
> > pars it, process it, and send it back to the front end (and there it is
> > converted again to "Cell[... " expressions.
>
> I guess I'm confused about that.  What is that other form?  For me to
> convert one form to another using Mathematica, I typically need to invoke
> the kernel.  Are you suggesting that the FrontEnd converts to internal form
> before sending the expression to the Kernel?
>
> > This should be transparent to the user, so I wonder, why is this so
> > important to you?
> > yehuda
>
> There are many reasons I'm interested in how this all works.  One of the
> more bothersome aspects of Mathematica for me is the fact that it often
> changes what I input into what it thinks I wanted.  I understand that it is
> trying to /help/ me, and often it does.  OTOH, I prefer XEmacs over, say,
> Mozilla composer for authoring xhtml (I don't do html).  I like to see
> exactly what I am doing with the code.  I rarely use GUI builders, or other
> graphical code generation tools.  When I do, without exception I look at
> the source code, be it Java, C++, XUL, or whatever.
>
> The Mathematica Book says: "Mathematica uses various syntactic rules to
> interpret input that you give, and to convert strings and boxes into
> expressions. The version of these rules that is used for StandardForm and
> InputForm in effect defines the basic Mathematica language. The rules used
> for other forms, such as TraditionalForm, follow the same overall
> principles, but differ in many details."  That to me is an interesting
> statement in so much as it seems to suggest that FullForm is not "the basic
> Mathematica language". I would have said FullForm is the basic language of
> Mathematica had I been asked prior to reading that paragraph.
>
> I'm currently investigating technologies related to MathML, OpenMath, and
> OMDoc.  There are often multiple representations of the same expression in
> the same document when working with these encodings.  Part of my objective
> is to figure out what it would take to make the Mathematica FrontEnd an XML
> document editor.  There are several different aspects of that challenge.
> One of which is determining what is presented to the user, and what can be
> presented to the user.  I would like to be able to see the FullForm of an
> expression in a popup window, or in a separate widget within the current
> window.
>
>
> --
> "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
>
>


--
http://chrischiasson.com/contact/chris_chiasson


  • Prev by Date: Re: How was this typed?
  • Next by Date: Inconsistent evaluation
  • Previous by thread: Re: 2.9.2 How Input and Output Work
  • Next by thread: Re: Re: 2.9.2 How Input and Output Work