Convert a Python object back into a Lisp-readable string.
(exp: object)
| 129 | print(lispstr(val)) |
| 130 | |
| 131 | def lispstr(exp: object) -> str: |
| 132 | "Convert a Python object back into a Lisp-readable string." |
| 133 | if isinstance(exp, list): |
| 134 | return '(' + ' '.join(map(lispstr, exp)) + ')' |
| 135 | else: |
| 136 | return str(exp) |
| 137 | # end::REPL[] |
| 138 | |
| 139 |
no outgoing calls
no test coverage detected