5 ms·
I know people talk about python being Lisp without brackets, but for example in SBCL and in other lisps like clojure I could just run a larger function, figure
by ilrwbwrkhv 2y ago
I know people talk about python being Lisp without brackets, but for example in SBCL and in other lisps like clojure I could just run a larger function, figure out that there is the wrong output, change a tiny function in it, eval that, eval the larger output, get the result. In SBCL there is also the break loop which is just magical.
I do not know how you do that in python without using a debugger and stepping through the code line by line. To be fair I used Python only a little bit almost a decade back. Are things more interactive now?
- zelphirkalt 2y agoI think in Python REPL you just have to redefine the whole larger function. I am not aware of a way to access internally bound identifiers, or even modify what values they are bound to.
- int_19h 2y agoFor starters, those identifiers aren't bound until the function actually runs.
- codr7 2y agoThe condition framework/break loop is one thing I wish more Lisps would copy.
- ilrwbwrkhv 2y agoThats the one thing I miss in Clojure from CL. Although technically due to Clojure' immutability you have to do the same number of changes. But just dropping into the break loop, updating, continuing is just magic.
- codr7 2y agoMakes the REPL feel a lot more alive and interactive, much like a SmallTalk IDE.
- sodapopcan 2y ago> I know people talk about python being Lisp without brackets What on earth?? Who are these people, this is the first I've heard of this and am having trouble understanding what the argument could be. Like, basically all languages get transformed to an AST as part of the compile step soooo I guess any language is sort of a lisp.
- jodrellblank 2y agoPeter Norvig: https://www.norvig.com/python-lisp.html https://www.norvig.com/python-lisp.html - "Basically, Python can be seen as a dialect of Lisp with "traditional" syntax (what Lisp people call "infix" or "m-lisp" syntax). One message on comp.lang.python said "I never understood why LISP was a good idea until I started playing with python." Python supports all of Lisp's essential features except macros, and you don't miss macros all that much because it does have eval, and operator overloading, and regular expression parsing, so some--but not all--of the use cases for macros are covered." "Take a Lisp program, indent it properly, and delete the opening parens at the start of lines and their matching close parens, and you end up with something that looks rather like a Python program." also Peter Norvig on HN: https://news.ycombinator.com/item?id=1803815 https://news.ycombinator.com/item?id=1803815
- sodapopcan 2y agoHa, fair enough. Thanks!