3 ms·
> Couldn't you add something equivalent to Lisp macros to languages like > Perl or Python? > > Not without turning them into dialects of Lisp. Real macros
by Estragon 15y ago
> Couldn't you add something equivalent to Lisp macros to languages like
> Perl or Python?
>
> Not without turning them into dialects of Lisp. Real macros need to
> operate on the parse tree of the program.
Actually, I've thought about porting some of On Lisp to python using
lib2to3 (http://docs.python.org/library/2to3.html http://docs.python.org/library/2to3.html) It's probably an obscenely bad idea, but I keep getting drawn back to it...
- apgwoz 15y agoHow does 2to3 help you with this? If you intend to port macros, you're sort of out of luck in python.
- njharman 15y agoPG's requirements; public ally exposed parse tree and ability to manipulate it before "compiling" doesn't python provide already? It just seems more in your face and 1st class sin lisp.