[slime-devel] slime-input-stream and REPL extensions

Helmut Eller e9626484 at stud3.tuwien.ac.at
Tue Jan 20 19:56:31 UTC 2004


Christian Lynbech <christian.lynbech at ericsson.com> writes:

> Would it be possible to change `slime-input-stream' to become a real
> stream rather than just a struct?

slime-input-stream is a subclass of lisp::lisp-stream, so it a real
stream.  (typep *standard-input* 'stream) returns T.

> As a non-stream struct it tends to wreak havoc when some non-slime
> aware code tries to operate on *standard-input*.
> 
> My concrete problem is with Paul Foleys (mycroft at actrix.gen.nz)
> repl-ext package that allows one to do Allegro style repl commands,
> and I have come to absolutely love this. This wants to replace the
> toplevel REPL but does not know how to handle slime-input-streams. The
> fix is rather simple, but I think it would make slime more robust if
> it would not be necessary to fix all packages that needs to operate on
> *standard-input* one by one. 

The repl-ext has a function wait-for-input-available that dispatches
on the type of the stream, but only fd-stream, synonym-stream, and
two-way-stream are covered.  As a workaround you could add a clause
(stream nil).

> Obviously, I have no idea how difficult such a thing would be, but it
> may be worth keeping in the back of your heads :-)

Paul Foleys code assumes that the stream is a fd-stream (or a wrapper
around a fd-stream).  It would be fairly difficult to make
slime-input-streams a subclass of fd-stream.  I think it isn't worth
the trouble.  Modifying wait-for-input-available as above or turning
it into a generic function with a method for slime-input-streams would
be much easier.

> Another thing would be to consider integrating repl-ext into slime, it
> is really nice, IMHO.

The current REPL is partly implement in ELisp and partly in CL.  If we
implement the REPL entirely in Lisp we lose some control.  We couldn't
tell ordinary output from the prompt or the return value.  I think
that isn't desirable.

We could implement some of the commands in Emacs Lisp, e.g by
special-casing input like ":pwd" or perhaps better ",pwd".  Would you
like to work on this?

Helmut.




More information about the slime-devel mailing list