A prompt-read-eval-print loop.
(prompt='lis.py> ')
| 92 | ################ Interaction: A REPL |
| 93 | |
| 94 | def repl(prompt='lis.py> '): |
| 95 | "A prompt-read-eval-print loop." |
| 96 | while True: |
| 97 | val = eval(parse(input(prompt))) |
| 98 | if val is not None: |
| 99 | print(lispstr(val)) |
| 100 | |
| 101 | def lispstr(exp): |
| 102 | "Convert a Python object back into a Lisp-readable string." |