gnu.emacs.help
[Top] [All Lists]

Re: Purpose of dash # in elisp

Subject: Re: Purpose of dash # in elisp
From: Pascal J. Bourguignon
Date: Sun, 08 Nov 2009 22:29:12 +0100
Newsgroups: gnu.emacs.help

Nordlöw <per.nordlow@xxxxxxxxx> 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__

<Prev in Thread] Current Thread [Next in Thread>