beowulf.reader.char-reader
Provide sensible line editing, auto completion, and history recall.
None of what’s needed here is really working yet, and a pull request with a working implementation would be greatly welcomed.
What’s needed (rough specification)
- Carriage return does not cause input to be returned, unless a. the number of open brackets
(
and closing brackets)
match; and b. the number of open square brackets[
and closing square brackets]
also match; aborts editing and returns the string STOP
;and scroll back and forward through history, but ideally I’d like this to be the Lisp history (i.e. the history of S-Expressions actually read by READ
, rather than the strings which were supplied toREAD
);offers potential auto-completions taken from the value of (OBLIST)
, ideally the current value, not the value at the time the session started;and offer movement and editing within the line.
get-reader
Return a reader, first constructing it if necessary.
NOTE THAT this is not settled API. The existence and call signature of this function is not guaranteed in future versions.
read-chars
(read-chars)
A drop-in replacement for clojure.core/read-line
, except that line editing and history should be enabled.
NOTE THAT this does not work yet, but it is in the API because I hope that it will work later!