2 ms·
There's closures and there's being able to transform the expression tree. Graham's On Lisp is a really interesting book https://paulgraham.com/onlisptext.html
by PaulHoule 1y ago
There's closures and there's being able to transform the expression tree.
Graham's On Lisp is a really interesting book
https://paulgraham.com/onlisptext.html https://paulgraham.com/onlisptext.html
which is allegedly about programming with macros but I'd say 80% of the time he implements something with closures and then makes a macro-based implementation that peforms better. That 80% can be done in Python and the other 20% you wouldn't want to do in Python because Python already has those features... And if you wanted to implement meta-objects in Python you would do it Pythonically.
Graham unfortunately doesn't work any examples that involve complex transformations on the expression trees because these are hard and if you want to work that hard you're better off looking at the Dragon book.
You can work almost all the examples in Norvig's Common Lisp book
https://www.amazon.com/Paradigms-Artificial-Intelligence-Programming-Studies/dp/1558601910 https://www.amazon.com/Paradigms-Artificial-Intelligence-Pro...
in Python and today Norvig would advocate that you do.
- Jtsummers 1y agoNorvig put PAIP up on Github a while ago: https://github.com/norvig/paip-lisp https://github.com/norvig/paip-lisp