Convert a Python object back into a Lisp-readable string.
(exp: object)
| 125 | print(lispstr(val)) |
| 126 | |
| 127 | def lispstr(exp: object) -> str: |
| 128 | "Convert a Python object back into a Lisp-readable string." |
| 129 | if isinstance(exp, list): |
| 130 | return '(' + ' '.join(map(lispstr, exp)) + ')' |
| 131 | else: |
| 132 | return str(exp) |
| 133 | |
| 134 | |
| 135 | ################ Evaluator |
no outgoing calls
no test coverage detected