all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* why not "stripes" in: (let ((zebra 'stripes) ...  ; strings vs symbols?
@ 2013-12-29 14:23 Gregor Zattler
  2013-12-29 16:00 ` Drew Adams
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Gregor Zattler @ 2013-12-29 14:23 UTC (permalink / raw)
  To: help-gnu-emacs

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...

I do not really understand how the   'stripes   are different
to   "stripes".  Isn't   'stripes   a notation for the symbol
stripes?   This would mean there is the notion of a symbol which
is bound to noting?

Could somebody please enlighten me as to what the differences
between "stripes" and 'stripes are

and

in which cases which notation is more useful/natural?

Thanks, Gregor
-- 
 -... --- .-. . -.. ..--.. ...-.-



^ permalink raw reply	[flat|nested] 22+ messages in thread
[parent not found: <mailman.10627.1388327081.10748.help-gnu-emacs@gnu.org>]
* Re: why not "stripes" in: (let ((zebra 'stripes) ... ; strings vs symbols?
@ 2013-12-30 16:46 Rustom Mody
  2014-01-01  4:53 ` Rustom Mody
       [not found] ` <mailman.10770.1388552064.10748.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 22+ messages in thread
From: Rustom Mody @ 2013-12-30 16:46 UTC (permalink / raw)
  To: help-gnu-emacs

 On Sunday, December 29, 2013 7:53:32 PM UTC+5:30, Gregor Zattler 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...

> I do not really understand how the   'stripes   are different
> to   "stripes".  Isn't   'stripes   a notation for the symbol
> stripes?   This would mean there is the notion of a symbol which
> is bound to noting?

> Could somebody please enlighten me as to what the differences
> between "stripes" and 'stripes are

> and

> in which cases which notation is more useful/natural?

 In http://www.catb.org/esr/faqs/hacker-howto.html Eric Raymond says:

 LISP is worth learning for a different reason — the profound
 enlightenment experience you will have when you finally get it. That
 experience will make you a better programmer for the rest of your
 days, even if you never actually use LISP itself a lot.

 So...
 You are almost there... at the Zen of Lisp!
 And getting lisp symbols is an important part of that

 Lisp is a completely bizarre language because unlike most others its
 primary data structure -- S-exp -- is identical to that used for (lisp) code.

 Very key to that is that symbols do double duty
 - they are variables like in other languages
 - they are data like strings in other languages

 For more on this look up homoiconicity
 Also Ive a blog post on that
http://blog.languager.org/2013/08/applying-si-on-sicp.html
 But for that you need to know scheme



^ permalink raw reply	[flat|nested] 22+ messages in thread
[parent not found: <mailman.10695.1388422033.10748.help-gnu-emacs@gnu.org>]

end of thread, other threads:[~2014-01-03 23:47 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-29 14:23 why not "stripes" in: (let ((zebra 'stripes) ... ; strings vs symbols? Gregor Zattler
2013-12-29 16:00 ` Drew Adams
2013-12-30 11:24 ` Thien-Thi Nguyen
     [not found] ` <mailman.10682.1388402467.10748.help-gnu-emacs@gnu.org>
2013-12-30 13:19   ` Damien Wyart
2013-12-30 15:12     ` Drew Adams
2013-12-30 17:21     ` Thien-Thi Nguyen
2013-12-31 17:52   ` Emanuel Berg
     [not found] <mailman.10627.1388327081.10748.help-gnu-emacs@gnu.org>
2013-12-29 23:39 ` Emanuel Berg
2013-12-30 15:27 ` Barry Margolin
  -- strict thread matches above, loose matches on Subject: below --
2013-12-30 16:46 Rustom Mody
2014-01-01  4:53 ` Rustom Mody
2014-01-02  5:30   ` Rustom Mody
     [not found]   ` <mailman.10827.1388640687.10748.help-gnu-emacs@gnu.org>
2014-01-02 14:31     ` Emanuel Berg
2014-01-03  5:00       ` Yuri Khan
     [not found]       ` <mailman.10894.1388725210.10748.help-gnu-emacs@gnu.org>
2014-01-03 23:47         ` Emanuel Berg
     [not found] ` <mailman.10770.1388552064.10748.help-gnu-emacs@gnu.org>
2014-01-01 17:26   ` Emanuel Berg
     [not found] <mailman.10695.1388422033.10748.help-gnu-emacs@gnu.org>
2013-12-31 18:24 ` Emanuel Berg
2014-01-01  2:00   ` Evans Winner
2014-01-01 17:29     ` Emanuel Berg
2014-01-01 19:02       ` Emanuel Berg
2014-01-02  4:28         ` Stefan Monnier
2014-01-02  4:39         ` Yuri Khan

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.