unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#22961: The read function does not support a lambda argument
@ 2016-03-09  8:37 Mihai Călin Bazon
  2016-03-09 18:27 ` John Mastro
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Mihai Călin Bazon @ 2016-03-09  8:37 UTC (permalink / raw)
  To: 22961

[-- Attachment #1: Type: text/plain, Size: 705 bytes --]

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

-- 
Mihai Bazon,
http://lisperator.net/

[-- Attachment #2: Type: text/html, Size: 1183 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-03-09 21:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-09  8:37 bug#22961: The read function does not support a lambda argument Mihai Călin Bazon
2016-03-09 18:27 ` John Mastro
2016-03-09 18:46 ` Andreas Schwab
2016-03-09 20:31 ` Kaushal Modi
2016-03-09 21:10   ` Mihai Călin Bazon

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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