|
|
|
|
|
by minopret
4231 days ago
|
|
I went through this in depth when I spent more time playing at writing a Lisp interpreter. I appreciate that these two features are crucial. 1. In the Python code of the interpreter, "Instead of making a recursive call that returns a value that is then immediately returned again by the caller, we can instead alter the value of x (and sometimes env) in the original invocation of eval(x, env). We are free to do that whenever the old value of x is no longer needed." That is how we implement proper tail calls. Thus we avoid inflating the call stack needlessly, continually, and hugely. 2. Testing. The rest seems incremental to me, at least by comparison. I'm not even that excited about the famous Lisp macros. I think I haven't arrived there yet. I do appreciate that backquote reduces contortions just like `%` aka `str.format` does in Python. |
|