A prompt-read-eval-print loop.
(prompt: str = 'lis.py> ')
| 116 | ################ Interaction: A REPL |
| 117 | |
| 118 | def repl(prompt: str = 'lis.py> ') -> NoReturn: |
| 119 | "A prompt-read-eval-print loop." |
| 120 | global_env = Environment({}, standard_env()) |
| 121 | while True: |
| 122 | ast = parse(input(prompt)) |
| 123 | val = evaluate(ast, global_env) |
| 124 | if val is not None: |
| 125 | print(lispstr(val)) |
| 126 | |
| 127 | def lispstr(exp: object) -> str: |
| 128 | "Convert a Python object back into a Lisp-readable string." |
no test coverage detected