Review of first draft John Cowan (20 Apr 2020 14:11 UTC)
Re: Review of first draft Lassi Kortela (20 Apr 2020 15:02 UTC)
Re: Review of first draft Marc Nieper-Wißkirchen (20 Apr 2020 15:19 UTC)
Re: Review of first draft Lassi Kortela (20 Apr 2020 15:35 UTC)
Re: Review of first draft Marc Nieper-Wißkirchen (20 Apr 2020 15:45 UTC)
Loading code from standard input Lassi Kortela (20 Apr 2020 16:01 UTC)
Re: Loading code from standard input Marc Nieper-Wißkirchen (20 Apr 2020 16:30 UTC)
Re: Loading code from standard input Lassi Kortela (20 Apr 2020 16:49 UTC)
Re: Loading code from standard input John Cowan (20 Apr 2020 17:36 UTC)
Re: Loading code from standard input Lassi Kortela (26 May 2020 12:38 UTC)
Re: Loading code from standard input John Cowan (26 May 2020 17:36 UTC)
Re: Loading code from standard input Lassi Kortela (26 May 2020 17:45 UTC)
Re: Loading code from standard input John Cowan (26 May 2020 17:52 UTC)
Re: Loading code from standard input Lassi Kortela (26 May 2020 18:06 UTC)
Re: Loading code from standard input Marc Nieper-Wißkirchen (26 May 2020 18:12 UTC)
Re: Loading code from standard input Lassi Kortela (26 May 2020 18:50 UTC)
Re: Loading code from standard input Vladimir Nikishkin (27 May 2020 07:48 UTC)
Re: Loading code from standard input Lassi Kortela (27 May 2020 08:07 UTC)
Re: Review of first draft John Cowan (20 Apr 2020 16:02 UTC)

Re: Loading code from standard input Lassi Kortela 27 May 2020 08:07 UTC

Hi, and thanks for commenting on this SRFI :)

> IDEs like to connect to a repl with a non-tty.

Absolutely, and this is a very important use case for the future.

However, the IDEs should not be using the normal command line REPL which
is optimized for humans typing at text terminals. They should be using a
pipe or socket which speaks a reliable protocol designed for machine
parsing.

> I think, geiser does that, and maybe scheme-mode too (not sure about DrRacket).

Not sure about what they do. We should explore that at some point and
draft a Language Server Protocol (LSP) style SRFI :)

Common Lisp's SLIME (and, in particular, its SWANK backend) are also
worth studying. I recall SWANK is even implemented for some Schemes.

> In a perfect world, an interpreter should have something like
> "channels", and it should be possible to explicitly indicate which
> "channel" to read the code from, and which the data.

That's why `current-input-port` is a parameter object :) You can rebind
it (either lexically or globally) to `(read)` from a different port.

> Relying on a istty() is not a good option, because (read) may even
> need to launch a separate GUI frame (window) for input, if the
> current-input-port is configured to do so on being read.

We would only be relying on isatty() to check whether we should buffer
all the source code from stdin before doing a `read` of that code. This
would not interfere with any calls to `read` made by user code.