mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-11 23:07:36 +02:00
Issue #453 - Proper handing of EOF at the REPL
Finally handle EOF correctly and do not exit REPL if an expression evaluates to the EOF object. However, allow CTRL-d to exit the REPL.
This commit is contained in:
parent
a9438b5c07
commit
fd4aa4fae6
2 changed files with 10 additions and 8 deletions
|
@ -22,6 +22,7 @@ Features
|
||||||
Bug Fixes
|
Bug Fixes
|
||||||
|
|
||||||
- Arthur Maciel replaced high resolution code in the runtime to use `clock_gettime` instead of `gettimeofday`.
|
- Arthur Maciel replaced high resolution code in the runtime to use `clock_gettime` instead of `gettimeofday`.
|
||||||
|
- Fixed the REPL to no longer automatically exit if an expression evaluates to EOF. However, the REPL will exit as a special case if the EOF character is entered directly, for example via CTRL-D on Linux.
|
||||||
|
|
||||||
## 0.27 - March 5, 2021
|
## 0.27 - March 5, 2021
|
||||||
|
|
||||||
|
|
|
@ -47,11 +47,12 @@
|
||||||
(newline)
|
(newline)
|
||||||
(repl))
|
(repl))
|
||||||
(display "cyclone> ")
|
(display "cyclone> ")
|
||||||
(let ((c (eval (read))))
|
(let ((obj (read)))
|
||||||
(cond
|
(if (eof-object? obj)
|
||||||
((not (eof-object? c))
|
(newline) ;; Quick way to exit REPL
|
||||||
(write c)
|
(let ((c (eval obj)))
|
||||||
(newline)
|
(if (eof-object? c)
|
||||||
(repl))
|
(display "<EOF>")
|
||||||
(else
|
(write c))
|
||||||
(display "\n"))))))))
|
(newline)
|
||||||
|
(repl))))))))
|
||||||
|
|
Loading…
Add table
Reference in a new issue