4 ms·
It's not fair to say that Lisp programs "modify their own instructions", certainly not in the sense that some assembly programs do. Lisp macros are better thoug
by ced 16y ago
It's not fair to say that Lisp programs "modify their own instructions", certainly not in the sense that some assembly programs do. Lisp macros are better thought of as code generators, or as small compilers. They should never modify their inputs.
It'd be an error to modify code in Common Lisp anyway. But presumably, back when Lisp was mostly interpreted, it would have been possible. I wonder how much that was used.
Hey, in a dynamically-scoped, interpreted Lisp, would it be possible to simulate a closure by modifying code? Assuming that a list whose CAR is 'LAMBDA is a proper function, then one could simply replace the closed over variables with SUBLIS, at run-time. Then add in a level of indirection to get mutability. That'd be horribly slow, granted.