4 ms·
1. Cells can pass arbitrary information to each other. 2. Python cells could modify their own code just as easily (if not easier) than Lisp cells.
by jemfinch 16y ago
1. Cells can pass arbitrary information to each other.
2. Python cells could modify their own code just as easily (if not easier) than Lisp cells.
- Raphael_Amiard 16y ago> 2. Python cells could modify their own code just as easily (if not easier) than Lisp cells. I'm not expert on the topic, but what do you mean by easier ? By using eval ? Is it really easier than altering an expression tree stored in a list ?
- jemfinch 16y agoShow me how you would write self-modifying code in Lisp and I'll be happy to show you the analog. Replacing functions at runtime in Python is just as easy as replacing them at runtime in Lisp.
- ErrantX 16y agoAh, you might be setting yourself up for a fall there :) one of Lisp's key elements if the ability to be self modifying (a large amount of Lisp code you will see is self-modifying) to an extraordinary degree. Python doesn't even begin to match it's abilities in this arena. (intro: http://www.fact-index.com/s/se/self_modifying_code.html http://www.fact-index.com/s/se/self_modifying_code.html)
- jemfinch 16y ago> Ah, you might be setting yourself up for a fall there :) No, I'm not. Give your example. > Python doesn't even begin to match it's abilities in this arena. Sure it does. Give your example. To quote your (useless) link: "TODO an example and discussion of 'high-level' self-modifying code such as in LISP."
- ErrantX 16y agoI am no Lisper - so someone else will have to do that. But it was shown to me on a couple of occasions and Lisp's abilities are stellar! The problem is: Replacing functions at runtime in Python is just as easy as replacing them at runtime in Lisp. Is not the be all and end all of self-modifying code :) EDIT: this is a pretty good intro to Lisp Macro's http://www.apl.jhu.edu/~hall/Lisp-Notes/Macros.html http://www.apl.jhu.edu/~hall/Lisp-Notes/Macros.html The code examples on there are fairly simple though (but it starts you in the right direction). For example one thing Python is currently unable to do is modify a line in a function to do something completely arbitrary (well, theoretically you could code a specific line to be able to do that, but it wouldn't be trivial to make an entire function that could be trivially modified on the fly). [we are now at the extent of my Lisp knowledge]
- jemfinch 16y ago> I am no Lisper - so someone else will have to do that. So you're making claims without firsthand knowledge? Awesome. > Is not the be all and end all of self-modifying code :) It's the vast majority of what people actually do in Lisp, and Python supports it just fine. > EDIT: this is a pretty good intro to Lisp Macro's http://www.apl.jhu.edu/~hall/Lisp-Notes/Macros.html http://www.apl.jhu.edu/~hall/Lisp-Notes/Macros.html Macros have nothing to do with self-modifying code. You clearly have no idea what you're talking about. Macros are compile-time transformations of code: they have no runtime effect whatsoever. > The code examples on there are fairly simple though (but it starts you in the right direction). Dude, I've got PG's ANSI Common Lisp on my bookshelf and I've read On Lisp multiple times. I understand macros. What I don't understand is this Lisp worship evinced by people who actually have no idea what they're talking about with respect to self-modifying code. > For example one thing Python is currently unable to do is modify a line in a function to do something completely arbitrary (well, theoretically you could code a specific line to be able to do that, but it wouldn't be trivial to make an entire function that could be trivially modified on the fly). Provide a Lisp example of "modifying a line in a function" that runs in SBCL and I'll show you the same code in Python. Seriously: you're the one making a claim here, you need to be backing it up. P.S. I remain utterly unimpressed by the anonymous coward downmodding me, upmodding you, but clearly either unwilling or (more likely) unable to defend your claim. More semi-religious Lisp fanaticism <yawn>.