Always Compilable Code
An idea for a Lisp/Scheme editor in which code is always kept syntactically correct while allowing standard sequences of keystrokes to insert code.
So, all new typing appears in a raised text-box until a complete, valid identifier is entered, at which point its entire tree gets inserted with default values. For example, typing “(if” and pressing space would insert “(if #t #t #f)”, with the first “#t” highlighted. Then, for example, “(< ” would insert “(< 0 1)” with the 0 highlighted. Typing “x” and pressing space would yield:
(if (< x 1) #t #f)
with the 1 highlighted. Completing the conditional “(< x 1)” and pressing space would highlight the #t, etc. Completion lists would be offered at all times (except numbers or strings).
How does backspace work? It should be consistent with typing, so that mistakes can be corrected with backspace as in normal typing.