Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion Lisp and Scheme with fewer parentheses / Mathematica??
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Richard J. Fateman  
View profile  
 More options Nov 14 2006, 2:58 pm
Newsgroups: comp.lang.lisp
From: "Richard J. Fateman" <fate...@eecs.berkeley.edu>
Date: Tue, 14 Nov 2006 11:58:23 -0800
Local: Tues, Nov 14 2006 2:58 pm
Subject: Re: Lisp and Scheme with fewer parentheses / Mathematica??

Jon Harrop wrote:

> Everything in Mathematica is a "macro" because it is a rewrite system so
> all "functions" are actually rewrite rules that map exprs to exprs whereas
> functions in normal languages map values to values.

1. Rule-based transformation systems such as Mathematica are not doing
macro-expansions. Macro expansions typically map "templates for
programs" into "programs".  Mathematica programmers typically define
rules  (though they think of them as conventional functions for the most
part). There are lots of rule-based systems. Prolog is perhaps most
prominent today, but there were lots of expert system tools designed
over the last 20 years, and before that there were languages like SNOBOL.

2. I don't know what distinction you mean to make by referring to
"normal" languages, but in Lisp as well as in Mathematica, a value can
be an arbitrary symbolic expression. Lisp is better at issues involving
scope, binding, functions, but not so much so that a typical
physicist/programmer would necessarilyu notice.

> Take computing the symbolic derivative for example:

> d[x_, x_] := 1
> d[_Symbol | _?NumericQ, x_] := 0
> d[f_ + g_, x_] := d[f, x] + d[g, x]
> d[f_ g_, x_] := f d[g, x] + g d[f, x]

> That doesn't seem too "hard to write". It uses infix operators in both
> patterns and expressions. Perhaps symbolic maths is a special case where
> syntax helps but I can't think why that would be.

3. Computer-assisted symbolic math is a special case for infix because
so many people use infix notation for non-computer-assisted symbolic
math. Unfortunately, the full scope of math notation as input syntax    is
substantially missing from Mathematica, C, Python ... Compare any of
these languages to TeX.  (Mathematica tries to provide for typesetting,
but mostly as output. So do other computer algebra systems like Maple,
Macsyma/Maxima, ...)

The substantial failure of infix notation outside of the realm of simple
arithmetic is often unnoticed by people who use programming languages
primarily for simple arithmetic!  Pick up a symbolic logic textbook and
open it up in the middle, and see if you can figure out the syntax.  It
is pretty hard because typically the infix operator  " "   (that is, a
space)  or concatenation  (that is, no space), has several meanings.  In
fact, in conventional algebra, concatenation is overloaded. consider
a(b+c)   vs.  f(b+c)  vs cos(b+c).   What operation is implicit just to
the left of the (?    How many meanings are there for "." in your
favorite infix language?...

My belief is that an excess of infix notation is a crutch. It certainly
helps if you are weak, but hinders you if you are pushing the limits.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google