Subject: bug#22961: closed (Re: bug#22961: The read function does not support a lambda argument)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 09 Mar 2016 18:47:02 +0000

Your bug report

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

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
22961: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22961
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#22961: The read function does not support a lambda argument
From: Andreas Schwab <[email-masked]>
To: Mihai Călin Bazon <[email-masked]>
Cc: [email-masked]
Date: Wed, 09 Mar 2016 19:46:41 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Should be fixed in commit 711ca36.

Andreas.

-- 
Andreas Schwab, [email-masked]
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

Subject: The read function does not support a lambda argument
From: Mihai Călin Bazon <[email-masked]>
To: [email-masked]
Date: Wed, 9 Mar 2016 10:37:28 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

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/