Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Mathematica and Lisp
Replies: 83   Last Post: Mar 5, 2013 10:12 PM

 Messages: [ Previous | Next ]
 David Bailey Posts: 714 Registered: 11/7/08
Re: Mathematica and Lisp
Posted: Feb 25, 2013 2:19 AM

On 24/02/2013 04:31, Richard Fateman wrote:

> It means that for many people the misconceptions that they have about
> precedences are never revealed to them because they don't use FullForm,
> and their programs are buggy. There are hosts of arbitrary precedences
> among // /. /; _ _? .... that ordinary mathematics does not have, so
> the ordinary math-familiar occasional programmer has no solid clue.
> For example, do you know offhand if Pi x // Sin is Sin[Pi*x] or
> Pi*Sin[x] ? Do you realize that if you type Sin Pi x you see as a
> result, Pi Sin x. so it seems that Mathematica believes sin(pi*x) =
> pi*sin(x).
>

I think anyone with some Mathematica experience uses a selection of
operators, such as /. etc. and spells out other things longhand. For
example, I always write Map rather than use the /@ operator. On the
other hand, I use the // operator a lot, so I was able to answer your test.

>
> How do you know this? Do you have a survey? Just curious how you can say
> this.

Well, I have seen a fair bit of beginner Mathematica code, both from my
consultancy and from answering questions on this forum. Practically
nobody presents their code in full FullForm! For example, hardly anyone
would spell out CompoundExpression rather than use a semicolon.

Suppose that FullForm were the only acceptable input to Mathematica -
which you would appear to advocate. Would you want FullForm output also?
That would result in some pretty ugly maths, so perhaps you would relent
at this point, but part of the convenience of Mathematica is that you
can paste bits of output back into other input!

Program bugs are often to be found in obscure bits of code that are hard
to read. Formulae are obviously far easier to read if they are not
written in FullForm (or Lisp!).

I would concede that it might be a good idea if certain built in symbols
such as Sin had a new attribute such as NonAlgebraic that forbade their
use in expressions like Sin Pi x.

The real truth is that conventional written maths is hopelessly
ambiguous without context. That is why you can come up with expressions
like Sin x - or indeed f(x). Likewise hardly any maths/physics paper
would spell out those multiplications that were non-commutative (e.g. by
using a special operator) - the reader is just meant to figure it out.
Thus every CAS has to resolve those ambiguities one way or another. I'd
say Stephen Wolfram's design is about as good as you can get - and
certainly better than Lisp!

David Bailey
http://www.dbaileyconsultancy.co.uk

Date Subject Author
1/11/13 amzoti
1/12/13 Richard Fateman
1/12/13 David Bailey
1/14/13 Richard Fateman
1/14/13 David Bailey
1/16/13 Richard Fateman
1/18/13 David Bailey
1/22/13 Richard Fateman
1/22/13 David Bailey
1/24/13 Richard Fateman
1/25/13 Richard Fateman
1/26/13 Murray Eisenberg
1/26/13 Murray Eisenberg
1/26/13 W. Craig Carter
1/16/13 Murray Eisenberg
1/16/13 Richard Fateman
1/16/13 David Bailey
1/18/13 Murray Eisenberg
1/31/13 Noqsi
2/2/13 Daniel Lichtblau
2/3/13 Richard Fateman
2/2/13 Richard Fateman
2/3/13 David Bailey
2/5/13 Richard Fateman
2/6/13 David Bailey
2/6/13 Richard Fateman
2/3/13 Andrzej Kozlowski
2/5/13 Richard Fateman
2/6/13 David Bailey
2/5/13 Bill Rowe
2/6/13 Joseph Gwinn
2/3/13 Matthias Bode
2/3/13 Noqsi
2/6/13 Richard Fateman
2/6/13 David Bailey
2/6/13 mathgroup
2/4/13 Alex Krasnov
2/6/13 Noqsi
2/8/13 Richard Fateman
2/9/13 János Löbb
2/9/13 Richard Fateman
2/10/13 michael
2/10/13 Bill Rowe
2/8/13 Andrzej Kozlowski
2/8/13 Noqsi
2/9/13 Richard Fateman
2/10/13 David Bailey
2/9/13 Matthias Bode
2/15/13 Noqsi
2/17/13 David Bailey
2/18/13 Joseph Gwinn
2/18/13 David Park
2/22/13 Richard Fateman
2/23/13 David Bailey
2/23/13 Richard Fateman
2/25/13 David Bailey
2/26/13 Richard Fateman
2/27/13 Bill Rowe
2/27/13 Richard Fateman
3/2/13 Bill Rowe
3/3/13 Richard Fateman
3/3/13 Noqsi
3/5/13 Richard Fateman
3/5/13 Vince Virgilio
3/3/13 Bob Hanlon
1/16/13 Noqsi
1/16/13 Richard Fateman
1/18/13 Noqsi
2/23/13 Dr. Peter Klamser
2/25/13 Richard Fateman
2/26/13 Noqsi