[Larceny-users] confusing the lexer
Jed Davis
jdev at panix.com
Fri Nov 9 12:03:51 EST 2007
Speaking of bugs that other users might encounter: if a control
character (other than the usual CR/LF/HT/&c.) is entered into the REPL,
for example because I accidentally hit an arrow key or ^P or some such,
the result is an infinite loop of this:
Error: get-datum: Lexical Error: Incomplete or illegal token: INPUT PORT *console-input*>
Computation is not continuable.
debug>
Error: get-datum: Lexical Error: Incomplete or illegal token: INPUT PORT *console-input*>
Computation is not continuable.
debug>
Error: get-datum: Lexical Error: Incomplete or illegal token: INPUT PORT *console-input*>
Computation is not continuable.
debug>
which needs a SIGQUIT to terminate (i.e., SIGINT does nothing).
It would be more helpful to consume the offending character before
complaining of it, to ensure a finite number of errors on finite input.
--
(let ((C call-with-current-continuation)) (apply (lambda (x y) (x y)) (map
((lambda (r) ((C C) (lambda (s) (r (lambda l (apply (s s) l)))))) (lambda
(f) (lambda (l) (if (null? l) C (lambda (k) (display (car l)) ((f (cdr l))
(C k))))))) '((#\J #\d #\D #\v #\s) (#\e #\space #\a #\i #\newline)))))
More information about the Larceny-users
mailing list