Flush current-output-port after writing prompt to it

On Unix-like operating systems stdio.h (which Cyclone seems to use
internally) is line-buffered. As such, the prompt will only be written
after a newline character is written (since the prompt itself doesn't
contain a newline) which is probably not what was
intended here. This commit fixes this issue by always flushing the
current-output-port after writing the prompt string.
This commit is contained in:
Sören Tempel 2021-08-03 11:36:14 +02:00
parent b69b65756b
commit e3d7b6eed9

View file

@ -47,6 +47,7 @@
(newline)
(repl))
(display "cyclone> ")
(flush-output-port)
(let ((obj (read)))
(if (eof-object? obj)
(newline) ;; Quick way to exit REPL