From: "Mihai Călin Bazon" <mihai.bazon@gmail.com>
To: 22961@debbugs.gnu.org
Subject: bug#22961: The read function does not support a lambda argument
Date: Wed, 9 Mar 2016 10:37:28 +0200 [thread overview]
Message-ID: <CAOUqiQ0iMbUAZ8jKwYbthnGtssXsJWkiu2cejNQJJpSMTfjBpg@mail.gmail.com> (raw)
[-- 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 --]
next reply other threads:[~2016-03-09 8:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-09 8:37 Mihai Călin Bazon [this message]
2016-03-09 18:27 ` bug#22961: The read function does not support a lambda argument 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
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAOUqiQ0iMbUAZ8jKwYbthnGtssXsJWkiu2cejNQJJpSMTfjBpg@mail.gmail.com \
--to=mihai.bazon@gmail.com \
--cc=22961@debbugs.gnu.org \
/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 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).