iris icon indicating copy to clipboard operation
iris copied to clipboard

`C-d` doesn't quit the REPL immediately if at least one form has been evaluated

Open wasamasa opened this issue 7 years ago • 4 comments

If I run iris and hit C-d, it quits the REPL immediately.

If I run iris, evaluate something, then hit C-d, it doesn't quit the REPL. Hitting C-d again quits the REPL.

I'm using the latest Iris installed with go get github.com/asciian/iris on Arch Linux.

wasamasa avatar May 05 '18 10:05 wasamasa

In Windows Subsystem for Linux, there is no problem about this issue. And in macOS, I have same problem. So I guess that this is the problem about the implementation of TTY. To fix this bug, I need to rewrite whole implementation about /reader module. It's big changes. I recommend you using rlwrap in your terminal. It maybe help you.

tani avatar May 06 '18 10:05 tani

Hm, good point about rlwrap, but it doesn't change anything about that bug. I only get the other features, like line editing.

wasamasa avatar May 06 '18 12:05 wasamasa

Yes. rlwrap doesn't fix this issue. rlwrap is quick answer for this issue. Of cource I promise you to fix this issue. For instance, I think that I must rewrite the parser with flex/yacc-style parser or PEG-parser because it has a few of problem like this issue.

If I change the parser, I have to change not only some code but also whole tests around the parser.

tani avatar May 06 '18 13:05 tani

I report progress. Now I start new reader and parser.

  • Splitting REPL and Reader (REPL will be used goreadline)
  • Using parser combinator (ex goparsec)
  • If parse error occurred, REPL wait new input at next line. (Currently reader waits each characters)

tani avatar May 22 '18 00:05 tani