unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: pjb@informatimago.com (Pascal J. Bourguignon)
To: help-gnu-emacs@gnu.org
Subject: Re: Purpose of dash # in elisp
Date: Sun, 08 Nov 2009 22:29:12 +0100	[thread overview]
Message-ID: <87k4y09047.fsf@galatea.local> (raw)
In-Reply-To: ba5d5e0f-2f0b-4b9f-842f-626da886de50@15g2000yqy.googlegroups.com

Nordlöw <per.nordlow@gmail.com> writes:

> What purpose does # as a quote suffix?

What's the relationship between this question and the one asked in the
Subject: apart from the # character?



Lisp texts are read from left to right.   When a quote appears, it is
read alone.  Then another object is read (an object is built depending
on the characters read), and the list (quote <the-object-read>) is
returned.

There's no such notion of quote suffix.



Then, when you read # character other characters are read to determine
what must be read.  First, if digits appears they are interpreted as
an integer in base ten, and are used as an argument to the "reader
macro" (there's no "reader macro" per se in emacs lisp, although its
reader implements most of the standard reader macros of Common Lisp).
The first non digit character following the # determines what must be
read.

Subchar   What is read       What is returned

   =      one expression     that expression       this expression is remembered 
                                                   under the numerical index given.
   #      nothing            the expression that
                             was remembered under
                             the given numerical 
                             index.      

   '      one expression     the list (function that-expression)

   :      the name of        a new uninterned symbol with that name
          a symbol

   (      a list             a string with properties (the characters
                             come from the first item of the list
                             which must be a string, the properties
                             follow).

 etc      etc                etc  You should read the emacs lisp manual.

other     nothing            nothing               an invalid syntax error is signaled.
   

-- 
__Pascal Bourguignon__


  reply	other threads:[~2009-11-08 21:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-08 20:01 Purpose of dash # in elisp Nordlöw
2009-11-08 21:29 ` Pascal J. Bourguignon [this message]
2009-11-09 10:53 ` Tassilo Horn
     [not found] ` <mailman.10334.1257764064.2239.help-gnu-emacs@gnu.org>
2009-11-09 13:00   ` Pascal J. Bourguignon
2009-11-09 17:27     ` Lennart Borgman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k4y09047.fsf@galatea.local \
    --to=pjb@informatimago.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).