Another way to show that Lisp was neater than Turing machines was to write a universal Lisp function and show that it is briefer and more comprehensible than the description of a universal Turing machine. This was the Lisp function eval..., which computes the value of a Lisp expression.... Writing eval required inventing a notation representing Lisp functions as Lisp data, and such a notation was devised for the purposes of the paper with no thought that it would be used to express Lisp programs in practice.
Steve Russell said, look, why don't I program this eval..., and I said to him, ho, ho, you're confusing theory with practice, this eval is intended for reading, not for computing. But he went ahead and did it. That is, he compiled the eval in my paper into [IBM] 704 machine code, fixing bugs, and then advertised this as a Lisp interpreter, which it certainly was. So at that point Lisp had essentially the form that it has today....
1(defun foo (n)
2 (lambda (i) (incf n i)))
1sub foo {
2 my ($n) = @_;
3 sub {$n += shift}
4}
1foo: n 2 |s| 3 s := n. 4 ^[:i| s := s+i. ]
return statements to return values:1function foo(n) {
2 return function (i) {
3 return n += i } }
1def foo(n):
2 s = [n]
3 def bar(i):
4 s[0] += i
5 return s[0]
6 return bar
1def foo(n):
2 return lambda i: return n += i
1def foo(n):
2 lambda i: n += i
1def foo(n): 2 class acc: 3 def __init__(self, s): 4 self.s = s 5 def inc(self, i): 6 self.s += i 7 return self.s 8 return acc(n).inc
1class foo: 2 def __init__(self, n): 3 self.n = n 4 def __call__(self, i): 5 self.n += i 6 return self.n
__call__, seems a bit of a hack.1public interface Inttoint {
2 public int call(int i);
3}
4
5public static Inttoint foo(final int n) {
6 return new Inttoint() {
7 int s = n;
8 public int call(int i) {
9 s = s + i;
10 return s;
11 }};
12}
Any sufficiently complicated C or Fortran program contains an ad hoc informally-specified bug-ridden slow implementation of half of Common Lisp.
lisp
Scheme: (define (foo n)
(lambda (i) (set! n (+ n i)) n))
Goo: (df foo (n) (op incf n _))
Arc: (def foo (n) [++ n _])