[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: why not "stripes" in: (let ((zebra 'stripes) ... ; strings vs symbo
From: |
Barry Margolin |
Subject: |
Re: why not "stripes" in: (let ((zebra 'stripes) ... ; strings vs symbols? |
Date: |
Mon, 30 Dec 2013 10:27:01 -0500 |
User-agent: |
MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) |
In article <mailman.10627.1388327081.10748.help-gnu-emacs@gnu.org>,
Gregor Zattler <telegraph@gmx.net> wrote:
> Dear emacsophiles,
>
> ATM i read "An Introduction to Programming in Emacs Lisp". In
> the section where the let function is explained in detail the
> author, Robert J. Chassell, uses this "silly" example:
>
> (let ((zebra 'stripes)
> (tiger 'fierce))
> (message "One kind of animal has %s and another is %s."
> zebra tiger))
>
> which when evaluated produces "One kind of animal has stripes and
> another is fierce." as output.
>
> The thing which makes me wonder is why he uses 'stripes instead
> of "stripes" in this example. In the output of the message
> function it makes no difference but to me it seems more natural
> to use strings here since they are part of a string in the output...
It may be a (very) old habit. Early versions of Lisp didn't have
strings. To do what we do now with strings, they would typically use a
symbols whose print-name is the string, or a list of single-character
symbols (depending on whether they needed to refer to the string as a
whole, or needed to extra substrings from it).
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***