[cl-faq] Fwd: [Gardeners] FAQ
Peter Seibel
peter at gigamonkeys.com
Thu Dec 15 17:28:40 CST 2005
[Just forwarding this message that was sent to Gardeners before I set
up cl-faq. Mostly so I can find it easily later. -Peter]
Begin forwarded message:
> From: Benjamin Tovar <mugrido at gmail.com>
> Date: December 12, 2005 8:25:22 PM PST
> To: gardeners at lispniks.com
> Subject: [Gardeners] FAQ
> Reply-To: Tending the Lisp Garden <gardeners at lispniks.com>
>
> Hi,
>
> I was thinking of about the FAQ Peter has proposed. I am
> a newbie myself, so I thought it will be very didactic to
> answer questions I do not have any idea :). Anyway,
> following the friendliness we want in this forming
> community, I thought that the FAQ should answer in a
> friendly manner what may be considered as trolls in c.l.l.
> Here is my proposal for the most asked question from
> someone coming to the language:
>
> --------------------------------------------------
> What's up with all of the parenthesis?
>
> Arguably the most frequent asked question.
>
> In Lisp, one thing to remember is that the border between
> program and data is not sharp. If this sounds weird to you,
> just consider the operating system in your computer. It
> treats programs and data in the same way, and it just
> happens that some of this data tells the operating system
> how to manipulate and produce more data. Thus, actually we
> use the idea of considering data and programs to be equal in
> an every day basis. It just happens that Lisp puts this
> powerful concept right in front in the hands of the
> programmer.
>
> With this in mind, how to define a syntax that homogenize
> programs and data so they can be manipulated in the same
> way? The answer Lisp provides is: with lists. Parenthesis
> are just used to delimit the beginning and end of such a
> list. Things get a little messy when there are several
> nested lists, but fortunately any respectable editor (see
> question ??) can help you managing the parenthesis. Using
> parenthesis in this way brings several advantages. One of
> them, for example, is that the programmer does not need to
> remember precedence rules when operators are applied, since
> the parenthesis make it explicit. Another one is that the
> programmer can manipulate the parse tree (link to wikipedia
> for the parse tree?) directly in the source code. Of course,
> this comes with a little price, and certainly the
> parenthesis may take a little to get accustomed to. But very
> quickly the pass from being visual noise, to be visual
> clues, and then, suddenly, one day, they disappear!
> (actually this never happens, but you have to say they do
> disappear so other programmers do not make fun of you).
>
> Accidentally, the creator of Lisp (McCarthy, question ??)
> did not think of the parenthesis as being the interface with
> the programmer. The program was supposed to be defined with
> m-expressions (meta-expressions, see question ??), with a
> syntax very similar to every other language (like C or
> Java). The m-expressions were supposed to be transformed
> into s-expressions (symbolic-expressions, see question ??),
> which are the lists Lisp manipulates. Programmers found that
> manipulating the parse tree directly was much more powerful,
> and m-expressions were forgotten.
> -----------------------
>
> Greetings,
>
> Benjamin Tovar
> _______________________________________________
> Gardeners mailing list
> Gardeners at lispniks.com
> http://www.lispniks.com/mailman/listinfo/gardeners
--
Peter Seibel * peter at gigamonkeys.com
Gigamonkeys Consulting * http://www.gigamonkeys.com/
Practical Common Lisp * http://www.gigamonkeys.com/book/
More information about the cl-faq
mailing list