by xbpx · 3y ago · 0 comments
>Code evaluation, compilation, and macroexpansion.
>Online documentation (describe, apropos, hyperspec).
>Definition finding (aka Meta-Point aka M-.).
>Symbol and package name completion.
>Automatic macro indentation based on &body.
>Cross-reference interface (WHO-CALLS, etc).
https://slime.common-lisp.dev/
and i'm still wondering which of these things i can't do in a python repl? note macroexpansion doesn't count because that's not a dimension of the repl.
I couldn’t debug the following in pycharm and add the missing function at runtime, or could i?
def interactively_writing_code():
this_doesnt_exist_yet()
interactively_writing_code()
I don’t think i can patch a function at runtime without losing state either in python - the act of redefining the function causes the variables to be reset but in lisp the bindings are untouched.I'll say it again: you guys are in plain denial not about python or lisp as languages but about how interpreters work. There's just nothing more to be said about this dimension of it.
I hope it's possible somehow, but if you just load pdb (e.g. with %pdb in ipython), pdb is entered in post-mortem mode, from which it's impossible to modify code/data and resume execution. Setting a breakpoint (or pdb.set_trace()) would requiring knowing about the bug ahead of time. Does it only work when interrupting with a remote debugger rather than on exception?
However, it wouldn't be possible if the interpreter unwinds the stack looking for exception handlers before finding that there is none? In other languages/VMs such as SBCL the runtime can look up the stack for handlers, and invoke the debugger before destructively unwinding.
So is it possible to define the missing function and continue from the same state in Python? I don't think so, but I'm not a heavy Python user (just for small/medium scripts).