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)

  1. 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;
  2. aborts editing and returns the string STOP;
  3. 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 to READ);
  4. offers potential auto-completions taken from the value of (OBLIST), ideally the current value, not the value at the time the session started;
  5. 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!