From: Teemu Likonen <tlikonen@iki.fi>
To: Xue Fuqiao <xfq.free@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: About `read'
Date: Fri, 04 Jan 2013 15:44:16 +0200 [thread overview]
Message-ID: <87y5g9awr3.fsf@mithlond.arda> (raw)
In-Reply-To: <20130104213503.530b5f96a381422f2fbb6d6b@gmail.com> (Xue Fuqiao's message of "Fri, 4 Jan 2013 21:35:03 +0800")
Xue Fuqiao [2013-01-04 21:35:03 +0800] wrote:
> I have a question about read:
>
> (read "(I am) xfq")
> =>(I am)
>
> (read "I am xfq")
> =>I
>
> Why are they different? When does `read' skip whitespace characters?
Function READ reads one Lisp expression. In your first example the first
expression is a list of two symbols. In the second example the first
expression is symbol named "I".
read is a built-in function in `C source code'.
(read &optional STREAM)
Read one Lisp expression as text from STREAM, return as Lisp object.
If STREAM is nil, use the value of `standard-input' (which see).
STREAM or the value of `standard-input' may be:
a buffer (read from point and advance it)
a marker (read from where it points and advance it)
a function (call it with no arguments for each character,
call it with a char as argument to push a char back)
a string (takes text from string, starting at the beginning)
t (read text line using minibuffer and use it, or read from
standard input in batch mode).
next prev parent reply other threads:[~2013-01-04 13:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-04 13:35 About `read' Xue Fuqiao
2013-01-04 13:44 ` Teemu Likonen [this message]
2013-01-04 14:03 ` Xue Fuqiao
[not found] ` <mailman.16693.1357308229.855.help-gnu-emacs@gnu.org>
2013-01-04 16:07 ` Barry Margolin
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y5g9awr3.fsf@mithlond.arda \
--to=tlikonen@iki.fi \
--cc=help-gnu-emacs@gnu.org \
--cc=xfq.free@gmail.com \
/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.
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.