I found this comment on a lisp book called ANSI Common Lisp by Paul Graham from PH:
“With macros, closures and runtime typing Lisp transcends object-oriented programming. If you understood the preceding sentence you probably should not be reading this book.”
A closure is something like this:
; Lisp
(defun addn (n)
#’(lambda (x)
(+ x n) ))
This is a function that takes n as an argument and return the function x+n (not the result but the function).
A macro is a function that works on the language level and returns lets people build functions that build lisp expressions.
Runtime typing you know what it is.
We could take the comment has an exageration typical of people who just want to sell their fish. But that would be the easy way to dismiss that comment.
Giving it a little more thought: OO programming has a lot of type-checking at compile time but also a lot of runtime typing. Compile time type-checking as well as inheritance and dynamic binding are some of the strongest arguments of OO languages. With Lisp macros we can simulate compile-time type-checking and expand it as far as we want. Since Lisp supports closures, dynamic binding would be a piece of cake. In fact Lisp can emulate almost anything from OO with what the author mentioned in the above quote and still leave the choice of expansion to the user.
Its funny that the guy who made the javavm was also the author of a well known editor that used a version of lisp as a macro language to expand the editor that become one of the most successful in Unix world.
So my question is why do we need Java, Eiffel and C++ when we have Lisp ? If Lisp transcends OO then we should be using Lisp not Java. We could make a Lisp interpreter/compiler to the java vm that in theory would do everything Java does or is it not so ?