| Craig A. Finseth 2007-05-09, 7:06 pm |
| In article <Pine.LNX.4.64.0705091618250.27620@ttleush>,
Kjetil S. Matheussen <k.s.matheussen@notam02.no> wrote:
>On Wed, 9 May 2007, java.oke@gmail.com wrote:
[color=darkred]
[color=darkred]
[color=darkred]
[color=darkred]
[color=darkred]
>There is another reason, "a + b*c" is shorter than "(+ a (* b c))".
>Therefore I think the first one is quicker to grasp. And I don't think so
>because I learned "a + b*c" in school, I program lisp every day, and is
>more customed to the lisp style.
...
An S-expression's[*] strength is also its weakness. It uses one
notation for everything, so syntax is uniform and trivial. This
property is very important when you are trying to unify program and
data structure (and blur their distinction). It makes it easy to
create new conceptual structures because you don't have to fit it into
complex syntactic rules.
The weakness is that the syntax gives you no clue as to the semantics:
you have to read and understand each operator in order to know how to
interpret its semantics.
The algebraic notation -- and things like different uses of braces,
parentheses, and other syntactic elements in programming languages --
means that, once learned, you can apply syntactic information to aid
in and speed understanding of the semantic content. This is something
that we do all the time in written (and verbal) language use and so we
find it natural and easy. Losing the syntactic clues makes us have to
go to more effort to understand the semantics. This effect is
especially important if you are doing a cursory overview or just want
to get the gist of something: in many cases, the syntax is the
important thing.
For example, if I'm scanning a journal looking for a particular
article, I might glance at the equations and see a summation. That in
itself may tell me whether the article is the one I'm after.
So, I don't see us switching all languages to use S-expressions. But
that doesn't mean that Lisp should change.
Craig
[*] The same argument applies to RPN, Polish notation, XML, and many
others.
|