[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: About `read'

From: Teemu Likonen
Subject: Re: About `read'
Date: Fri, 04 Jan 2013 15:44:16 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.91 (gnu/linux)

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]