MCPcopy Index your code
hub / github.com/fluentpython/example-code-2e / repl

Function repl

18-with-match/lispy/original/lis.py:94–99  ·  view source on GitHub ↗

A prompt-read-eval-print loop.

(prompt='lis.py> ')

Source from the content-addressed store, hash-verified

92################ Interaction: A REPL
93
94def 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
101def lispstr(exp):
102 "Convert a Python object back into a Lisp-readable string."

Callers

nothing calls this directly

Calls 3

evalFunction · 0.70
parseFunction · 0.70
lispstrFunction · 0.70

Tested by

no test coverage detected