g0dzill3r / lispy

Scheme interpreter in Kotlin
0 stars 0 forks source link

[Feature] Allow for multi-line / continuous input into the repl #11

Closed jaredpetker closed 1 year ago

jaredpetker commented 1 year ago

The mit-scheme (local) repl allows for continous entry into the repl across newline boundaries until the root expression is complete.

Downloaded mit-scheme for macos from instructions here: https://groups.csail.mit.edu/mac/users/gjs/6.945/dont-panic/

g0dzill3r commented 1 year ago

The real problem is editing the past. You can keep a working buffer and then provide sed-like commands for mutating that state where there are edits to be made.

g0dzill3r commented 1 year ago

Check out MultilineTest. It's a single line editor with these commands:

p - print buffer
d - delete last line
c - clear buffer
e - execute buffer
? - show these commands
g0dzill3r commented 1 year ago

Here's an example session:

Screenshot 2023-01-05 at 8 26 37 AM
g0dzill3r commented 1 year ago

The number of rows in the buffer is in the prompts. And the ":" means it's not a valid expression. A "." means it's valid and ready for execution.