public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Helmut Eller <eller.helmut@gmail.com>
To: kawa@sourceware.org
Subject: Re: Prompt on read
Date: Tue, 21 Nov 2017 23:31:00 -0000	[thread overview]
Message-ID: <m28tezfbur.fsf@caladan> (raw)
In-Reply-To: <b9109562-725d-0410-fa04-7326faca91b8@bothner.com>

On Tue, Nov 21 2017, Per Bothner wrote:

>> Despite that the prompt in line two is confusing, the line number in the
>> third prompt seems wrong.  I would expect that read works basically like
>> read-line,
>
> Yes and no.  read reads an S-expression, and there may be a many-to-many
> relationship between S-expressions and lines.  A prompt is printed before
> each input line -

If a prompt is printed before each input line, then why does calling
read-line not print a prompt? 

> however note it is possible for a procedure to change the
> prompt, for example to the empty string.

You mean something like (fluid-let ((input-prompt1 "")) ...)  or
something else?  Hmm, that would work for me.

> FWIW I can't come up with any valid use-case for explicitly calling
> read on an interactive port.  The problem is error recovery.
> Enlighten me.

Uhm, a REPL that wants to print its own prompt?  Or something like

(format #t "Please enter a filename: ")
(open-output-file (read))

Helmut

  reply	other threads:[~2017-11-21 23:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-21 15:44 Helmut Eller
2017-11-21 22:49 ` Per Bothner
2017-11-21 23:31   ` Helmut Eller [this message]
2017-11-22 21:27     ` Per Bothner
2017-11-22 23:11       ` Helmut Eller
2017-11-26  3:32       ` Per Bothner

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m28tezfbur.fsf@caladan \
    --to=eller.helmut@gmail.com \
    --cc=kawa@sourceware.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.
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).