bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#22961: The read function does not support a lambda argument


From: Mihai Călin Bazon
Subject: bug#22961: The read function does not support a lambda argument
Date: Wed, 9 Mar 2016 10:37:28 +0200

Example, I eval this in the scratch buffer (with lexical-binding set true):

    (read (let ((str "TEST")
                (pos 0)
                (prev nil))
            (lambda (ch)
              (cond
                (ch (push ch prev))
                (prev (pop prev))
                ((< pos (length str))
                 (prog1 (aref str pos)
                   (setq pos (1+ pos))))))))

According to the docs [1] an input stream can be a function.  I would expect the above to return the symbol TEST, but instead I get an error ("end of file during parsing").

[1] http://www.gnu.org/software/emacs/manual/html_node/elisp/Input-Streams.html#Input-Streams

--

reply via email to

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